Last active
February 1, 2018 10:10
-
-
Save unhammer/bf1237fbef4f7c768b3f72a05ddbd074 to your computer and use it in GitHub Desktop.
grep '[A-Z]' vs locale
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
$ echo aðc | LANG=C.UTF-8 grep -o '[[:lower:]]' | |
a | |
ð | |
c | |
$ echo aðc | LANG=C.UTF-8 grep -o '[[:upper:]]' | |
$ echo aðc | LANG=C.UTF-8 grep -o '[A-Z]' | |
$ # so far so good | |
$ echo aðc | LANG=nn_NO.UTF-8 grep -o '[[:lower:]]' | |
a | |
ð | |
c | |
$ echo aðc | LANG=nn_NO.UTF-8 grep -o '[[:upper:]]' | |
$ echo aðc | LANG=nn_NO.UTF-8 grep -o '[A-Z]' | |
ð | |
$ echo WðT | iconv -f iso-8859-1 -t utf-8 | |
WðT | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment