After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 765118 - W32: gtk-builder-tool botches output encoding
W32: gtk-builder-tool botches output encoding
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2016-04-15 17:47 UTC by LRN
Modified: 2016-04-15 19:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtk-builder-tool: use g_printf() instead of g_print() (5.36 KB, patch)
2016-04-15 17:47 UTC, LRN
committed Details | Review

Description LRN 2016-04-15 17:47:25 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.
Comment 1 LRN 2016-04-15 17:47:33 UTC
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).
Comment 2 Matthias Clasen 2016-04-15 19:05:31 UTC
Review of attachment 326122 [details] [review]:

sure, makes sense
Comment 3 LRN 2016-04-15 19:25:53 UTC
Attachment 326122 [details] pushed as 3ed9cb2 - gtk-builder-tool: use g_printf() instead of g_print()