GNOME Bugzilla – Bug 765118
W32: gtk-builder-tool botches output encoding
Last modified: 2016-04-15 19:25:57 UTC
When running "gtk-builder-tool-3.0 simplify utf8file.ui > simplified.ui", where utf8file.ui has utf-8-encoded strings, the resulting simplified.ui file contains strings encoded in system codepage instead of UTF-8. This happens because g_print() is used for output, and default g_print() handler does automatic output string convertion from UTF-8 to system codepage.
Created attachment 326122 [details] [review] gtk-builder-tool: use g_printf() instead of g_print() 1) g_print() can be redirected 2) g_print() does some extra processing, such as character set conversion. Specifically, on W32 it will detect system codepage via GetACP(), and will convert UTF-8 output into that codepage, even though the output should stay unchanged (whether gtk-builder-tool interprets strings from ui files as UTF-8 is a separate matter).
Review of attachment 326122 [details] [review]: sure, makes sense
Attachment 326122 [details] pushed as 3ed9cb2 - gtk-builder-tool: use g_printf() instead of g_print()