Discussion:
Why is not wildcards unfolded as expected if LANG is ja_JP.UTF-8
Masachika ISHIZUKA
2018-06-24 15:54:42 UTC
Permalink
Hi.

I can't expand wildcards as expected if I use 'setenv LANG ja_JP.UTF-8'.
For example,

% mkdir test
% cd test
% foreach a (a b c d e A B C D E)
foreach? touch $a
foreach? end
% ls
a A b B c C d D e E
% setenv LANG ja_JP.UTF-8
% ls [b-d]
b B c C d <=== It's not good.
% env LANG=ja_JP.UTF-8 ls [b-d]
b B c C d <=== It's not good.
% env LANG=C ls [b-d]
B C b c d <=== It's not good.
% setenv LANG C
% ls [b-d]
b c d <=== It's good.
% env LANG=ja_JP.UTF-8 ls [b-d]
b c d <=== It's good.
% env LANG=C ls [b-d]
b c d <=== It's good.
%

This happens on 12-current and 11.2-RC3. I'm using tcsh but the same
when changed to bash.
--
Masachika ISHIZUKA
Hajimu UMEMOTO
2018-06-24 17:56:24 UTC
Permalink
Hi,
On Mon, 25 Jun 2018 00:54:42 +0900 (JST)
ish> I can't expand wildcards as expected if I use 'setenv LANG ja_JP.UTF-8'.
ish> For example,

It seems to me as expected behavior.

ish> % ls
ish> a A b B c C d D e E
ish> % setenv LANG ja_JP.UTF-8
ish> % ls [b-d]
ish> b B c C d <=== It's not good.
ish> % env LANG=ja_JP.UTF-8 ls [b-d]
ish> b B c C d <=== It's not good.
ish> % env LANG=C ls [b-d]
ish> B C b c d <=== It's not good.

Since the expansion of '[]' is done by the shell (tcsh) itself,
setting LANG by env(1) doesn't have an influence on the expansion.

ish> This happens on 12-current and 11.2-RC3. I'm using tcsh but the same
ish> when changed to bash.

It's because the recent FreeBSD supports collation.
If you don't like the behavior, you may want to set LC_COLLATE to C.

% echo $LANG
ja_JP.UTF-8
% ls
a A b B c C d D e E
% env LANG=ja_JP.UTF-8 tcsh -c "ls [b-d]"
b B c C d
% env LANG=C tcsh -c "ls [b-d]"
b c d
% env LANG=ja_JP.UTF-8 LC_COLLATE=C tcsh -c "ls [b-d]"
b c d

Sincerely,

--
Hajimu UMEMOTO
***@mahoroba.org ***@FreeBSD.org
http://www.mahoroba.org/~ume/
Masachika ISHIZUKA
2018-06-25 00:10:00 UTC
Permalink
Post by Hajimu UMEMOTO
Post by Masachika ISHIZUKA
I can't expand wildcards as expected if I use 'setenv LANG ja_JP.UTF-8'.
[snip]
Post by Hajimu UMEMOTO
Post by Masachika ISHIZUKA
This happens on 12-current and 11.2-RC3. I'm using tcsh but the same
when changed to bash.
It's because the recent FreeBSD supports collation.
If you don't like the behavior, you may want to set LC_COLLATE to C.
Thank you very much.

It solved by setting LC_LOCCATE to C.
--
Masachika ISHIZUKA
Masachika ISHIZUKA
2018-06-25 00:15:10 UTC
Permalink
Post by Masachika ISHIZUKA
Post by Hajimu UMEMOTO
Post by Masachika ISHIZUKA
I can't expand wildcards as expected if I use 'setenv LANG ja_JP.UTF-8'.
[snip]
Post by Hajimu UMEMOTO
Post by Masachika ISHIZUKA
This happens on 12-current and 11.2-RC3. I'm using tcsh but the same
when changed to bash.
It's because the recent FreeBSD supports collation.
If you don't like the behavior, you may want to set LC_COLLATE to C.
Thank you very much.
It solved by setting LC_LOCCATE to C.
Sorry, the above is LC_COLLATE misspelling.
--
Masachika ISHIZUKA
Loading...