From c6f8a149574f4e5196f802439e7439406ca82e71 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 10 Jun 2007 13:02:43 +0200 Subject: Freetype font support; full UTF-8 support; dropped pixel fonts --- libsi/si.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'libsi/si.c') diff --git a/libsi/si.c b/libsi/si.c index aae9a2fb..2eb3dfd6 100644 --- a/libsi/si.c +++ b/libsi/si.c @@ -6,7 +6,7 @@ * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * - * $Id: si.c 1.19 2007/05/28 10:22:42 kls Exp $ + * $Id: si.c 1.20 2007/06/10 09:31:34 kls Exp $ * * ***************************************************************************/ @@ -219,7 +219,9 @@ char *String::getText() { int len=getLength(); if (len < 0 || len > 4095) return strdup("text error"); // caller will delete it! - char *data=new char(len+1); + char *data=new char(len+1); // FIXME If this function is ever actually used, this buffer might + // need to be bigger in order to hold the string as UTF-8. + // Maybe decodeText should dynamically handle this? kls 2007-06-10 decodeText(data, len+1); return data; } @@ -404,6 +406,9 @@ void String::decodeText(char *buffer, int size) { } bool singleByte; const char *cs = getCharacterTable(from, len, &singleByte); + // FIXME Need to make this UTF-8 aware (different control codes). + // However, there's yet to be found a broadcaster that actually + // uses UTF-8 for the SI data... (kls 2007-06-10) for (int i = 0; i < len; i++) { if (*from == 0) break; @@ -440,6 +445,9 @@ void String::decodeText(char *buffer, char *shortVersion, int sizeBuffer, int si } bool singleByte; const char *cs = getCharacterTable(from, len, &singleByte); + // FIXME Need to make this UTF-8 aware (different control codes). + // However, there's yet to be found a broadcaster that actually + // uses UTF-8 for the SI data... (kls 2007-06-10) for (int i = 0; i < len; i++) { if ( ((' ' <= *from) && (*from <= '~')) || (*from == '\n') -- cgit v1.2.3