Re: [Vala] Coding standard: indentation?
- From: Thomas Chust <chust web de>
- To: Frederik <scumm_fredo gmx net>
- Cc: vala-list <vala-list gnome org>
- Subject: Re: [Vala] Coding standard: indentation?
- Date: Wed, 11 Feb 2009 14:55:27 +0100
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.
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.
When C++ is your hammer, every problem looks like your thumb.
] [Thread Prev