3 ms·
> utf-8 is not a Locale. Of course it isn't. What I suggested above is to use neither locales nor UTF-8, but code points. "a" = U+0061 no matter which locale y
by kijin 8y ago
> utf-8 is not a Locale.
Of course it isn't. What I suggested above is to use neither locales nor UTF-8, but code points. "a" = U+0061 no matter which locale you're in, and no matter which encoding you use. Every locale and every encoding is based on the same universal mapping of characters to code points.
- oldmanhorton 8y agoSure, but those code points are arbitrary. For instance in German languages, you may want a-z to include umlauted vowels, or you may not. That's a locale specific setting, even though the umlauted characters come well outside of the range of ascii a to z.
- mmt 8y agoKeeping ranges undefined doesn't satisfy these wants, either. Using code points would at least allow for ranges to have the possibility of being usable to someone in a standard, predictable fashion, outside of the C/POSIX locale. For example, specifying a-z plus each umlauted vowel is still shorter than specifying all letters individually. Perhaps there is some wisdom in William S. Burrough's "If you can't be just, be arbitrary."
- dwheeler 8y ago> What I suggested above is to use neither locales nor UTF-8, but code points. I agree, I think that is the right thing to do for ranges. If you want "all alphas in the current locale", then you should use some special indicator like [:alpha:] that is defined to be that.