ropey has asked for the wisdom of the Perl Monks concerning the following question:
I just can't seem to get my head around locales... although looking through numerous posts...
So I have a multi lingual application, I want to match names based on the locale of the language (well at least its only Western European
...So I would expect this to work
use POSIX 'locale_h'; my $loc = 'de_DE.UTF-8'; # German locale, for example. Run 'locale -a +' #+ to get the exact locale name setlocale(LC_CTYPE, $loc) my $suspect = "vähicule"; if($suspect =~ /^\w+$/) { print STDERR "MATCHES\n"; }
I would expect the regex to match.. it doesn't... I am missing something....
...IS there a better way of doing such things ? all I need to do is check to see if a input matches as per the lang set....
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Locale Woes...
by fenLisesi (Priest) on Jun 04, 2007 at 11:15 UTC | |
Re: Locale Woes...
by graff (Chancellor) on Jun 04, 2007 at 12:21 UTC | |
Re: Locale Woes...
by shmem (Chancellor) on Jun 04, 2007 at 12:25 UTC | |
by andreas1234567 (Vicar) on Jun 04, 2007 at 13:13 UTC |