On Fri, 14 Jun 2013 13:56:57 +0000 Stefan Csomor wrote:
SC> > Sorry, do you mean that "de_CH" locale is not supported by Unix part of
SC> >OS X while "de_DE" is supported?
SC>
SC> yes, basically it's just that it has a de_XX impl, but no de_CH variant
Why hasn't Switzerland officially complained about it yet? In France there
would be demonstrations in the street if something like this happened :-/
SC> >SC> * is there a printf code we have which I could use ? where I could
SC> >SC> redirect all %d %f etc to the Core Foundation implementation and only
SC> >SC> do %c and %s by hand Š
SC> >
SC> > Yes, we have our own implementation in src/common/wxprintf.cpp. It uses
SC> >system_sprintf() (see include/wx/private/wxprintf.h) to actually convert
SC> >each field to a string, so you could, in principle, change the calls to it
SC> >in wxPrintfConvSpec<CharType>::Process() for wxPAT_[LONG]DOUBLE cases to
SC> >some other function which would have a separate implementation for OS X.
SC> >Whether or not this is a good idea, I'm less sure.
SC>
SC> this would allow to fix things at a central level, now do we have the same
SC> for scanf?
No, we rely on system vswscanf(). And it's really not obvious to solve
this from outside, i.e. the trick with replacing commas with dots (or vice
versa) wouldn't work for arbitrary strings, of course.
Does CF provide a vswscanf() replacement?
SC> because whatever I change, at least at the level I change it,
SC> it has to be round-trip-safe ..to.. and ..from.. have to be at the same
SC> workaround level
notice that wxString::ToDouble() doesn't use sscanf() but rather strtod().
SC> exactly, actually we have one printf implementation a c-runtime level
SC> which is rather incomplete, one a core foundation level which works
SC> correctly, but needs utf16 strings
I guess we really need to use wxNumberFormatter for floating point number
formatting. We can do whatever we want/need there and it's not a problem if
its behaviour is not exactly the same as that of printf(), that's the whole
point of having this class, in fact. So my suggestion is to do this there
and then also check that wxNumberFormatter is used in the components that
you care about, e.g. wxGrid.
SC> >Frankly, I don't see any good solution here. It would be so much simpler
SC> >if Apple just didn't randomly break things at Darwin level :-(
SC>
SC> yes, definitely Š
Would you have asked them about the probability of this being fixed at
WWDC by chance?
VZ