[SOLVED] Re: grep, ispunct() and locales/charsets
Leonard den Ottolander
leonard at den.ottolander.nl
Mon Jun 19 15:58:46 UTC 2006
Hi,
On Fri, 2006-06-16 at 15:32 +0200, Leonard den Ottolander wrote:
> $ export LANG=mk_MK.CP1251
> $ echo -e "\x85"
> …
> $ echo -e "\x85" | grep "[[:punct:]]"
> $
>
> Note that CP1251 is explicitly mentioned in mk_MK.
Although CP1251 is explicitly mentioned in the mk_MK locale file the
locale/charset combination isn't actually compiled as it is missing from
glibc/localedata/SUPPORTED.
Here is how I made this locale/charset combination available on my
system:
# mkdir /usr/local/lib/locale
# mkdir -p /usr/local/share/i18n/charmaps
# zcat /usr/share/i18n/charmaps/CP1251.gz \
> /usr/local/share/i18n/charmaps/CP1251
# localedef -f /usr/local/share/i18n/charmaps/CP1251 \
-i /usr/share/i18n/locales/mk_MK /usr/local/lib/locale/mk_MK.cp1251
# localedef --add-to-archive /usr/local/lib/locale/mk_MK.cp1251
$ export LANG=mk_MK.CP1251
$ echo -e "\x85." | sed -e 's/[[:punct:]]/x/g'
xx
Same approach can be taken for other locale/charset combinations (f.e.
en_US.CP1252).
Leonard.
--
mount -t life -o ro /dev/dna /genetic/research
More information about the users
mailing list