in reply to Re: Unicode Problem
in thread Unicode Problem

1) This is my environment values:
# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

I am running background process by calling the perl script.

Now I realised that after I have made changes to /etc/sysconfig/i18n, LC_CTYPE="en_US", I am able to see the correct result after running the script:

Wide character in print at ...
String: ¸§¹„¸¨¸­¸« test
Verify: ¸§¹„¸¨¸­¸« -- test

If I remove LC_CTYPE, this is the result:

String: ¸§¹„¸¨¸­¸« test
Verify: ¸§¹„¸¨¸­¸« -- test

Another thing puzzle me, even if I configure the LC_CTYPE="en_US". The output result is correct, however the background process when running the perl script still give me the wrong result. Is there a file to configure system wide LC_CTYPE??

I am not sure where could be the problem now?

Is it my system? environment?

Or is it my script but the $string variable output is correct, however the capture expression $1 is wrong.
did I miss something here?

Replies are listed 'Best First'.
Re^3: Unicode Problem
by speedlight (Initiate) on Feb 04, 2005 at 09:15 UTC
    Hi,
    I logged the background process to a file, in the perl script, I added a new command to log the locale environment:

    LANG=POSIX
    LC_CTYPE=POSIX
    LC_NUMERIC=POSIX
    LC_TIME=POSIX
    LC_COLLATE=POSIX
    LC_MONETARY=POSIX
    LC_MESSAGES=POSIX
    LC_PAPER=POSIX
    LC_NAME=POSIX
    LC_ADDRESS=POSIX
    LC_TELEPHONE=POSIX
    LC_MEASUREMENT=POSIX
    LC_IDENTIFICATION=POSIX
    LC_ALL=

    How can I modify the locale settings for the background process?

      You need to stop and restart the process. The process will use the current environment.