[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debian-devel:09549] locale bug ? (Re: Re: mh-ja in potato-jp)



ä½é‡Žï¼ æµœæ¾ã§ã™ã€‚

In article <19990614194810P.xlj06203@xxxxxxxxxxxxxxxxxxxx>
 ç§:

> ã‚„ã£ã¨åŽŸå› ãŒã‚ã‹ã‚Šã¾ã—ãŸã€‚bash ã® bug ã§ã™ã€‚(bug-ja ãŒå‹•ã‹ãªããªã£ã¦
> ã„ã‚‹ã®ã¨åŒã˜) LANG=ja_JP.ujis LC_ALL 設定無ã—ã ã¨ [A-Z]* ã« å°æ–‡å­—ãŒ
> 全部åå¿œã—ã¦ã—ã¾ã„ã¾ã™ã€‚LC_ALL=C ã¾ãŸã¯ LC_ALL 設定無ã—㧠LANG=C ã¨
> ã™ã‚Œã°ã¡ã‚ƒã‚“㨠[A-Z]* ã§å¤§æ–‡å­—ã ã‘åå¿œã—ã¾ã™ã€‚

ã“ã‚Œã£ã¦ã€Œbash ã® bugã€ã¨ã„ã†ã‚ˆã‚Šã€ã€Œglibc2.1 ã® locale ã«é–¢ã™ã‚‹ bugã€
ãªã‚“ã§ã—ょã†ã‹ã€‚å‰å±±ã•ã‚“や花高ã•ã‚“ã®ä½œæ¥­ã«æœŸå¾…ã€ãªã®ã‹ãª ?

ç¾åœ¨ã®ç’°å¢ƒã¯

ii  libc6           2.1.1-10       GNU C Library: Shared libraries and timezone
ii  ldso            1.9.11-2       The Linux dynamic linker, library and utilit
ii  locale-ja       2.1.1.1        Locale definition files for Japanese.
ii  locales         2.1.1-10       GNU C Library: National Language (locale) da

-- System Information
Debian Release: potato
Kernel Version: Linux yadon 2.2.9 #1 Fri Jun 11 14:20:32 JST 1999 i586 unknown

ã§ã™ã€‚

確èªã™ã‚‹ã«ã¯

for i in a b c x y z A B C X Y Z; 
  do 
    case "$i" in 
     [A-Z]) echo "$i is capital";; 
     [a-z]) echo "$i is small";; 
    esac; 
  done

をファイルã«ä¿å­˜ã—ã¦ã€ sh ã§å®Ÿè¡Œã—ã¦ã¿ã¦ãã ã•ã„。
例ãˆã° chk.sh ã¨ã„ã†åå‰ã§ä¿å­˜ã—ã¦ã€ sh chk.sh を実行ã™ã‚‹ã¨

 $ /bin/sh ./chk.sh 
a is capital
b is capital
c is capital
x is capital
y is capital
z is small
A is capital
B is capital
C is capital
X is capital
Y is capital
Z is capital

ã¨ãªã‚Šã¾ã™ã€‚(LANG=ja_JP.ujis ã¨ã—ã€LC_ALL, LC_COLLATE ã¯æœªè¨­å®š)

最åˆã®ã‚³ãƒžãƒ³ãƒ‰åã‚’ /bin/bash, bash, sh ã¨ã—ã¦ã‚‚åŒæ§˜ã«ãªã‚Šã¾ã™ã€‚

export LC_COLLATE=C ã¨ã™ã‚Œã°

sh ./chk.sh 
a is small
b is small
c is small
x is small
y is small
z is small
A is capital
B is capital
C is capital
X is capital
Y is capital
Z is capital

ã¨æœŸå¾…ã•ã‚Œã‚‹å‡ºåŠ›ã«ãªã‚Šã¾ã™ã€‚

é¢ç™½ã„ã“ã¨ã«ã€export LC_COLLATE=en_US ã®å ´åˆã‚‚

a is capital
b is capital
c is capital
x is capital
y is capital
z is small
A is capital
B is capital
C is capital
X is capital
Y is capital
Z is capital

ã¨ãªã‚Šã¾ã™ã€‚LANG=en_US, unset LC_COLLATE ã§ã‚‚åŒæ§˜ã€‚

ã¾ãŸ export LC_COLLATE=japan ã¨ã™ã‚‹ã¨ã€ä¸Šè¨˜ã®æœŸå¾…ã•ã‚Œã‚‹å‡ºåŠ›ã«
ãªã‚Šã¾ã™ã€‚(存在ã—ãªã„ locale å㯠C ã«è¨­å®šã•ã‚Œã‚‹ã®ã ã‚ã†ã‹)

ãã‚Œã‹ã‚‰ã€ã„ã£ãŸã‚“ LC_ALL=C, LC_COLLATE=C ã«è¨­å®šã—ã¦ã€
ãã®å¾Œã§ unset ã™ã‚‹ã¨ã€åŒã˜ã‚·ã‚§ãƒ«ã®ä¸­ã§ã¯ãã®è¨­å®šãŒç¶­æŒã•ã‚Œã‚‹
よã†ã§ã™ã€‚ç¾åœ¨ /etc/profile ã§

LANG=C
LC_COLLATE=C
LC_ALL=C
export LANG LC_COLLATE LC_ALL
unset LC_ALL LC_COLLATE

ã¨ã—ã¦ã¾ã™ãŒã€ã“ã®çŠ¶æ…‹ã‹ã‚‰ export LANG=ja_JP.ujis ã—ã¦ã‚‚

 $ printenv |grep LC

 $ printenv |grep LANG
LANG=ja_JP.ujis

 $ . ./chk.sh 
a is small
b is small
c is small
x is small
y is small
z is small
A is capital
B is capital
C is capital
X is capital
Y is capital
Z is capital

ã¨ãªã‚Šã€æ­£å¸¸å‹•ä½œã¨ãªã‚Šã¾ã™ã€‚

ã¨ã‚Šã‚ãˆãšã€export LC_COLLATE=C ã¨ã—ã¦ãŠã‘ã°è‰¯ã„ã®ã‹ãªã€
ã¨ã„ã†æ°—ã‚‚ã™ã‚‹ã‚“ã§ã™ãŒã€ã“ã‚Œã§æœ¬å½“ã«è‰¯ã„ã®ã‹ã©ã†ã‹ã€ã€ã€

-- 
     #ã‚ãŸã—ã®ãŠã†ã¡ã¯æµœæ¾å¸‚ã€ã€Œå¤œã®ãŠè“å­ã€ã§æœ‰åã•ã€‚
    <xlj06203@xxxxxxxxxxx> : Taketoshi Sano (ä½é‡Žã€€æ­¦ä¿Š)