Re: [Vala] Coding standard: indentation?



2009-02-10 Frederik <scumm_fredo 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.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]