different result of sorting when using ASCII locale (LC_ALL=C)
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I was reading one of the answers on how LC_ALL=C
can be used to speed up grep
searched. I understand all that when I test it using strace
but one thing that I don't understand is why sort
command give different output if locale
is set to C
,
cat a
C
B
A
c
a
b
using sorting with unicode,
$ cat a | sort
a
A
b
B
c
C
sort with LC_ALL=C
,
$ LC_ALL=C sort a
A
B
C
a
b
c
Both A
in unicode and ascii is 65
and a
in both is 97
, then why there is difference in sorting?
Can someone please explain why?
sort
add a comment |Â
up vote
0
down vote
favorite
I was reading one of the answers on how LC_ALL=C
can be used to speed up grep
searched. I understand all that when I test it using strace
but one thing that I don't understand is why sort
command give different output if locale
is set to C
,
cat a
C
B
A
c
a
b
using sorting with unicode,
$ cat a | sort
a
A
b
B
c
C
sort with LC_ALL=C
,
$ LC_ALL=C sort a
A
B
C
a
b
c
Both A
in unicode and ascii is 65
and a
in both is 97
, then why there is difference in sorting?
Can someone please explain why?
sort
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I was reading one of the answers on how LC_ALL=C
can be used to speed up grep
searched. I understand all that when I test it using strace
but one thing that I don't understand is why sort
command give different output if locale
is set to C
,
cat a
C
B
A
c
a
b
using sorting with unicode,
$ cat a | sort
a
A
b
B
c
C
sort with LC_ALL=C
,
$ LC_ALL=C sort a
A
B
C
a
b
c
Both A
in unicode and ascii is 65
and a
in both is 97
, then why there is difference in sorting?
Can someone please explain why?
sort
I was reading one of the answers on how LC_ALL=C
can be used to speed up grep
searched. I understand all that when I test it using strace
but one thing that I don't understand is why sort
command give different output if locale
is set to C
,
cat a
C
B
A
c
a
b
using sorting with unicode,
$ cat a | sort
a
A
b
B
c
C
sort with LC_ALL=C
,
$ LC_ALL=C sort a
A
B
C
a
b
c
Both A
in unicode and ascii is 65
and a
in both is 97
, then why there is difference in sorting?
Can someone please explain why?
sort
sort
asked 6 mins ago
MaverickD
1745
1745
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f479242%2fdifferent-result-of-sorting-when-using-ascii-locale-lc-all-c%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password