GNOME Bugzilla – Bug 752257
g_print in C / POSIX locale mangles strings that can be better transliterated to ASCII
Last modified: 2018-02-01 22:19:43 UTC
Several GNOME and GLib-using programs have non-ASCII UTF-8 output (mostly ellipses and dashes, sometimes accented Latin letters.) These are being substituted with '?' which looks wrong in --help output, e.g. "Déjà Dup" -> "D?j? Dup". Affected programs: gtk-launch, brasero, evince, eog, deja-dup, etc. Steps to reproduce: Compare --help output between UTF-8 locale and C/POSIX locale. Punctuation characters are replaced with '?'. $ gtk-launch --help $ LANG=C gtk-launch --help Suggested fix: g_print() strdup_convert() currently uses g_convert_with_fallback(). g_str_to_ascii() seems better ("…" -> "...", "Déjà" -> "Deja", etc.)
Created attachment 307287 [details] Screenshot illustrating problem. Screenshot of the problem. (I initially looked at iconv before finding g_str_to_ascii())
Created attachment 307288 [details] [review] Proposed patch
Disregard above suggestion - that would break other non-Unicode locales (such as KOI8-R). Trying to find an approach that catches non-translatable characters and transliterates something better than '?' (as above)
Thanks for taking the time to report this. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find. *** This bug has been marked as a duplicate of bug 502951 ***