[Tux4kids-commits] r867 - tuxtype/trunk/src
dbruce-guest at alioth.debian.org
dbruce-guest at alioth.debian.org
Tue Feb 3 22:36:13 UTC 2009
Author: dbruce-guest
Date: 2009-02-03 22:36:13 +0000 (Tue, 03 Feb 2009)
New Revision: 867
Modified:
tuxtype/trunk/src/alphabet.c
Log:
cleanup of utf conversion code
Modified: tuxtype/trunk/src/alphabet.c
===================================================================
--- tuxtype/trunk/src/alphabet.c 2009-02-03 15:29:37 UTC (rev 866)
+++ tuxtype/trunk/src/alphabet.c 2009-02-03 22:36:13 UTC (rev 867)
@@ -813,22 +813,22 @@
int ConvertToUTF8(wchar_t* wide_word, unsigned char* UTF8_word)
{
int i = 0;
- UTF8 temp_UTF8[1024];
- wchar_t temp_wchar_t[1024];
+ unsigned char temp_UTF8[1024];
+// wchar_t temp_wchar_t[1024];
- UTF8* UTF8_Start = &temp_UTF8[0];
+ unsigned char* UTF8_Start = temp_UTF8;
UTF8* UTF8_End = &temp_UTF8[1024 - 1];
- const wchar_t* wchar_t_Start = &temp_wchar_t[0];
- const wchar_t* wchar_t_End = &temp_wchar_t[1024 - 1];
+// const wchar_t* wchar_t_Start = &temp_wchar_t[0];
+// const wchar_t* wchar_t_End = &temp_wchar_t[1024 - 1];
iconv_t conv_descr;
size_t bytes_converted;
size_t in_length = (size_t)1024;
size_t out_length = (size_t)1024;
- wcsncpy(temp_wchar_t, wide_word, 1024);
+// wcsncpy(temp_wchar_t, wide_word, 1024);
DEBUGCODE {fprintf(stderr, "ConvertToUTF8(): wide_word = %S\n", wide_word);}
- DEBUGCODE {fprintf(stderr, "ConvertToUTF8(): temp_wchar_t = %S\n", temp_wchar_t);}
+// DEBUGCODE {fprintf(stderr, "ConvertToUTF8(): temp_wchar_t = %S\n", temp_wchar_t);}
//FIXME we may not need this now that we use pass "wchar_t" rather
//than "UTF-32" in the default case.
@@ -842,7 +842,8 @@
#endif
bytes_converted = iconv(conv_descr,
- &wchar_t_Start, &in_length,
+ &wide_word, &in_length,
+// &temp_UTF8, &out_length);
&UTF8_Start, &out_length);
LOG("completed iconv()\n");
More information about the Tux4kids-commits
mailing list