2009-02-10 Frederik <scumm_fr...@gmx.net>:
> Michel Salim wrote:
>> [...]
>> The string 'cr?me br?l?e' is 12 characters long and is stored in 15 bytes
>>
>> The accents disappear on printing?
>> [...]
>
> You're right. With print () it doesn't work, but with stdout.printf ()
> it works. That's strange.
> [...]

Hello,

it's not that strange, actually: print is GLib's g_print, which
expects a UTF-8 encoded string and tries to convert it into the
correct output encoding for the current locale. stdout.printf on the
other hand is the C library's fprintf, which simply writes the bytes
it gets to the target stream.

Therefore, if your locale setting doesn't match your terminal's output
encoding or if your program didn't call setlocale correctly, print is
very unlikely to work.

cu,
Thomas


-- 
When C++ is your hammer, every problem looks like your thumb.
_______________________________________________
Vala-list mailing list
Vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to