String::format relies internally on printf(), which is in turn affected by the system locale in how it handles decimal separators, etc.
Created attachment 41129 [details] patch written by Alp Toker In https://bugs.webkit.org/show_bug.cgi?id=18994 , Darin Adler r-'d this patch, but it is a step in the right direction.
*** Bug 31514 has been marked as a duplicate of this bug. ***
*** Bug 18985 has been marked as a duplicate of this bug. ***
Please don't forget of WebKit2, String::format() is used, for example, in the LocalizationStrategy: WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
We’ve reduced the number of call sites using String::format, but there are still quite a few left.
Darin, was the dependency on bug #176305 a mistake? It looks unrelated?
(In reply to Michael Catanzaro from comment #6) > Darin, was the dependency on bug #176305 a mistake? It looks unrelated? Yes, typo in bug number.
(In reply to Darin Adler from comment #7) > (In reply to Michael Catanzaro from comment #6) > > Darin, was the dependency on bug #176305 a mistake? It looks unrelated? > > Yes, typo in bug number. Corrected, it should have been bug 176035.
The scope of this bug is too narrow. I think what we really want to do is to eliminate WebKit project use of C library formatting functions in the printf family. Eliminating String::format is a necessary part of this, but not sufficient to cover the whole task. At some point we might want a bug about that.
(In reply to Darin Adler from comment #9) > The scope of this bug is too narrow. I think what we really want to do is to > eliminate WebKit project use of C library formatting functions in the printf > family. Eliminating String::format is a necessary part of this, but not > sufficient to cover the whole task. At some point we might want a bug about > that. E.g. our logging functions make heavy use of format specifiers. On Unix they boil down to fprintf(stderr, ...) but it takes some investigation every time I need to discover that. I push a lot of commits changing "%llu" to "%" PRIu64. uint64_t is long long unsigned int on Mac but just long unsigned int on Linux, so using %llu is an error. That's just one example of an annoying difference. Another: Mac has format specifiers that fprintf doesn't accept, e.g. %{private} or something like that. Logging will be a lot more annoying to do without formats, but safer indeed....
After r242014 <https://trac.webkit.org/changeset/242014>, String::format itself is now gone. But as Michael mentions above, logging is still using the former implementation of String::format.
Relanded in <https://trac.webkit.org/changeset/242308>.