Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
locale.c: Revamp finding if locale is UTF-8
This changes how this functionality works for the LC_CTYPE locale. On systems that have nl_langinfo() one can get a definitive answer from just that. Otherwise (or if that doesn't return properly) one can use mbtowc() to check if the UTF-8 byte sequence for the Unicode REPLACEMENT CHARACTER actually is considered to be that code point. This is also definitive. If the maximum byte string length for a character is too short to handle all Unicode UTF-8, we know without further checking that this isn't a UTF-8 locale, so can avoid the mbtowc check.
- Loading branch information
1 parent
0022a19
commit 1a19889
Showing
1 changed file
with
57 additions
and
67 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