gdatetime: Fix locale handling for nl_langinfo() calls
With the various macros we use to provide fallbacks for missing nl_langinfo() fields, the locale handling can become quite complex: nl_langinfo() returns strings encoded in the current locale, but C_() returns strings encoded in UTF-8 (by GLib convention — you do actually need to call bind_textdomain_codeset() to achieve this). There are various format specifiers, especially with the new %Ob, %OB, %Oh specifiers, which conditionally call nl_langinfo() or something based on C_(). This makes encoding handling difficult. Add additional macros which indicate whether the macros they’re paired with return something encoded in the current locale, or encoded in UTF-8. The user of the macro can then use these to work out whether to re-encode. Signed-off-by: Philip Withnall <withnall@endlessm.com> https://bugzilla.gnome.org/show_bug.cgi?id=793578
parent
f59c379c