Hi, On Fri, 27 Oct 2017, jan matejek wrote:
more and more packages need their locale to be set to something more sensible than C. This hit me while switching packages over to Python 3. Python gets its encoding from locale, so by default, it won't decode UTF-8 unless the appropriate encoding is set. Right now, when gtk-doc is switched to use Python 3, it won't build UTF-8 documentation.
This could be changed in gtk-doc itself (although that is impractical), but perhaps a better way is to change the default locale for spec scriptlets. Right now the macros set it to C. We could switch that to "C.UTF-8", "en_US.UTF-8", or export a special RPM variable that could be overriden in your spec file. Still, the default should be something with UTF-8 in it.
I'm now trying to build a Ring 1 staging project with this change. So far I have seen one failure related to it: with en_US.UTF-8, bash ranges (like [a-z]) are case-insensitive and match more than intended. That could be solved by changing the expression, or by setting locale to C.UTF-8.
Thoughts, comments?
As others have said already: this merely indicates a deeper problem in gtk-doc, for which a global change for all scriptlets is a crude work-around at best. As you found it has real ramifications. To see why it is a deeper problem in gtk-doc it's enough to think about the situation that some input files are in UTF-8 and some are in, let's say, SHIFT_JISX0213. No setting of $LANG will make it work, so setting $LANG is not the solution. Whatever the solution is, it must be in gtk-doc itself; it must somehow determine (and if by external knowledge) which files are in which encoding. Setting LANG to en_US.UTF-8 is a horrible idea for scripts (as you found out, collating order and ctypes get in the way as it's not ASCII compatible). Setting it to C.UTF-8 is not supported by upstream glibc (and yes it'd be nice if it would be). You need to find some other solution unfortunately. Ciao, Michael. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org