On 22 Dec 2008, at 23:26, Greg Ercolano wrote:

> matthiasm wrote:
>> On 22.12.2008, at 13:33, bibothekid wrote:
>>
>>> ok, this sounds strange, but
>>>
>>> can i disable the utf-8 behaviour in fltk 1.3 because i have trouble
>>> with string reading from the database.
>>
>> No, you can not.

What platform are you on? Do you need a cross-platform solution?

What format are the input strings in?

If they are supposed to be ASCII, and are getting garbled, then  
something is wrong, as true ASCII is a strict subset of UTF8 and so  
Just Works.

However, if the strings are encoded using some locale or codepage,  
then you will need to transliterate the character values from locale  
to UTF8 encoding. As Greg suggested, iconv is probably your best bet.

If you are on a win32 host, then the fltk-1.3 code provides a few  
methods to help with this (in a limited way) without using iconv or  
etc., so check out the "fl_codepage" global variable and the  
fl_locale_to_utf8() / fl_utf8_to_locale() functions. They may do  
enough to get you going.

If the strings are encoded in the "wrong codepage", but the codepage  
used is (compatible with) ISO-8859-1 latin1 then you should be able  
to get reasonable results simply using fl_utf8froma() which works on  
all fltk platforms (not just win32).
And if the data is in wchars of some sort, then fl_utf8fromwc() might  
help, although you might have to fiddle with things a bit to get it  
to do something sensible.

Also, you can easily check if your input text is UTF8 or not by  
calling fl_utf8test() on it and see what happens.






_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to