-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for C_EU.UTF-8 locale in ksh93 #177
Comments
From (among others) the https://www.gnu.org/software/libc/manual/html_node/Locale-Names.html page:
I am not aware of any non-AST implementation that provides support for "territory" extensions to the C or POSIX codeset. Given that Unicode encodings provide support for code points like the Euro currency symbol there should not be a need for the Anyone wanting support for EU formatting of numbers can do so by setting the The bottom line is that ksh should use the same distro provided library code that almost every other program uses for localization. If only ksh93 recognizes |
How are |
It's used with builtins for e.g.
|
Yes, but since it isn't a standard locale no other program will honor it. For example, if you do this on Ubuntu you get no thousands separator:
The |
Basically, this "feature" is nonstandard, only usable within ksh (or other programs built against the AST libraries), and guaranteed to be a source of confusion and bug reports. It should be removed. Even better would be to remove the ksh93 dependency on the AST locale support code and use what is provided by the OS. Which is what we're slowly doing with other things like the string manipulation functions. |
Agreed. If the locale is understood only by ksh built-ins, it is not very useful. |
I propose we remove the ksh dependency on the libast locale code ASAP unless someone provides a convincing argument for retaining the dependency. Like the SFIO subsystem and other parts of the AST code base it would have been great if it had been adopted by a the broader UNIX community. But that didn't happen. It would be better if ksh used the standard locale support provided by any (semi-)compatible POSIX environment. We should only be using fallback implementations to work around shortcomings of the target platform. Which for something like locale support should be done by mapping the POSIX functions to native functions rather than using an independent implementation. |
I agree that using local (re)implementation of the system libraries is a bad approach. The only thing I am afraid of is that switching the implementation of such a core functionality must have observable side effects and there is no reliable way to check in advance what is going to break in all the ksh scripts that people have been using for the last few decades. |
Yes, but at this point we're looking at the next published, stable, version being what amounts to a major release. Even if we don't implement any new features. Precisely because changes like this one have a very small, but non zero, chance of breaking existing uses. As a practical matter I will be surprised if there is anyone using the |
Hmmm, I suggest to study the code and tests a little bit deeper and if they were still not understood, just use online docs like ML archives, etc. to find out, why this feature exists, the intention behind it - google makes this really easy ;-) . A serious developer would have find out in < 5 min, that C_EU.UTF-8 and C.UTF-8 are "just" test locales, introduced with the intention to write regression tests with deterministic results across all |
Also disable a test case for C_EU.UTF-8 locale. This test case started failing after removing strtold function. See #177 for discussion about C_EU.UTF-8 locale.
I've removed the AST locale subsystem. While doing that work it became obvious that it mostly depended on the platform locale subsystem. So unless a non-standard extension, like locale Closing since this has been resolved by virtue of depending solely on whatever locales the platform provides. |
I could not find it documented anywhere, however there is one comment about this locale in the test cases :
The text was updated successfully, but these errors were encountered: