TowerGuard has asked for the wisdom of the Perl Monks concerning the following question:
The setlocale function seems to set the locale correctly as when I print $oldlocale and $newlocale I get en_US.UTF-8 and en_US respectively.use locale; use POSIX qw(locale_h); $oldlocale = setlocale(LC_CTYPE); $newlocale = setlocale(LC_CTYPE, "en_US");
However my length function still treats the multibyte characters in an undesired way.
How come when I change the locale at the UNIX prompt it works as desired but when I change it in the script, it does not?
Thanks,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: setlocale not working properly in perl script
by ikegami (Patriarch) on Jun 12, 2008 at 16:18 UTC | |
|
Re: setlocale not working properly in perl script
by ikegami (Patriarch) on Jun 12, 2008 at 15:54 UTC | |
by TowerGuard (Initiate) on Jun 12, 2008 at 16:39 UTC | |
by ikegami (Patriarch) on Jun 12, 2008 at 18:45 UTC | |
|
Re: setlocale not working properly in perl script
by TowerGuard (Initiate) on Jun 12, 2008 at 18:30 UTC |