我在www.gimp.org/win32找到这样一段文字,应该是解决国际化问题的关键: Internationalisation
GTK+ 1.3 for Windows (and GTK+ 2.0 on all platforms) uses Unicode internally. All strings you pass to GTK+ functions must be in UTF-8. You can not just use non-ASCII characters from some Windows single- or multi-byte codepage. To convert text from the default Windows codepage to UTF-8, it's easiest to use the g_locale_to_utf8 function in GLib. Remember to free the resulting string with g_free when you don't need it any longer.
但是我翻遍了glib(使用windows查找)都没有发现他提到的那个g_locale_to_utf8 函数,怎么办??? 版主回复: (2002-7-2 18:49:39) 呵呵,总算跟你取得联系了,昨天我被你一说,反正无聊,就也试着把reciteword移植到windows,忙了一晚上,把各个cpp文件编译成功了,可连接各个.o文件为exe时失败.我只找到了一些gtk1.2的资料,这个要你指定一下了 :) gsize bytes_read,bytes_written; tmp1 = g_locale_to_utf8(tmp1,-1,&bytes_read,&bytes_written,NULL); 这个函数是glib2里的. gtk1.3里应该也有. 我们再邮件联系吧. |
|