1 |
On Wednesday 14 November 2007 01:33:54 Jan Kundrát wrote: |
2 |
> Steve Long wrote: |
3 |
> >> Is [[:alpha:]] locale-safe? |
4 |
> > |
5 |
> > Yes, all POSIX character classes listed here are: |
6 |
> > http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap07.html |
7 |
> |
8 |
> Thanks for a nice link. If I read section 7.3.1 correctly, [[:alpha:]] |
9 |
> always contains those letters, but might contain more, depending on the |
10 |
> locale. So it's probably very minor point, but as long as the script |
11 |
> runs with user-provided locale, one should be explicit here. Or am I |
12 |
> missing something here? |
13 |
|
14 |
If you think [a-zA-Z] is being explicit then you are clearly missing |
15 |
something. E.g. if you google for the estonian alphabet you'll see a lot of |
16 |
ansi letters are after z in that alphabet. So on estonian locales those |
17 |
letters won't be included in [a-z] but they will be included in [:alpha:]. |
18 |
|
19 |
-- |
20 |
Bo Andresen |