Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
locale.c: Improve non-nl_langinfo() CODESET calc
Prior to this commit, on non-Windows platforms that don't have a nl_langinfo() libc function, the code completely punted computation of the CODESET item. I have not been able to figure out how to do this, even going to the locale definition files on disk (which may vary anyway), but we can do a lot better than punting. This commit adds three checks: 1) If the locale name is C or POSIX, we know the codeset 2) We can detect if a locale is UTF-8. If it is, that is the codeset. Many modern locales are of this ilk. 3) Failing that, some locales have the codeset appear in the name, following a dot. It isn't perfect, but it's a lot better than completely punting.
- Loading branch information
1 parent
ea8f6f5
commit ccda44c
Showing
2 changed files
with
62 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters