French Accented characters in xml file comes as numbers

Hello all, I am using AIX 7.1 and whenever xml files with accented French characters are read, for example Name Andree where the first e has accented mark on top, AIX should it as Andr�e but it comes as funny number characters for the first e. What do I need to fix this. I want to test with one ftpuser such as itftp by making changes on its profile and read the file before making global change on /etc/environments. Please help me fixing this. I have tried to change the language to en_US.UTF-8 and it still reads funny.

I have

LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8 on .profile for itftp user. 

Thank you

You need to decide whether you want to see English or French. English locales don't have accented vowels.

You might (or might not) have some luck with:

unset LC_ALL
export LANG=en_US.UTF-8
export LC_CTYPE=fr_FR.UTF-8

assuming that the French locales are loaded on your AIX system.

1 Like

Thank you Don. It is regular xml file that would have French Names once in a while and it needs to read both.

---------- Post updated at 11:49 PM ---------- Previous update was at 11:48 PM ----------

Don what does the second command export LC_CTYPE=fr_FR.UTF-8 do?

It uses a French locale for the definition of characters that are to be considered valid when looking at strings, character classes, etc. Setting LC_ALL to any value overrides any values assigned to LANG and all of the other LC_* locale setting environment variables (which is why the first step in my suggestion was to undefine LC_ALL).

But, of course, I don't have an AIX system to test and I just guessed at the name of a French locale based on a guess at the naming convention used on your system based on the name of your English UTF-8 locale.

Still the same problem Don. I have the locales loaded and I have this on itftp .profile

 unset LC_ALL
export LANG=en.US.UTF-8
export LC_CTYPE=fr_FR.UTF-8
  
 [root@teamaix]/app/user/itftp ->locale -a
C
POSIX
EN_US.UTF-8
EN_US
FR_CA.UTF-8
FR_CA
FR_FR.UTF-8@euro
FR_FR.UTF-8@preeuro
FR_FR.UTF-8
FR_FR@euro
FR_FR@preeuro
FR_FR
en_US.8859-15
en_US.ISO8859-1
en_US.UTF-8
en_US
fr_BE.8859-15@euro
fr_BE.8859-15@preeuro
fr_BE.8859-15
fr_BE.IBM-1252@euro
fr_BE.IBM-1252@preeuro
fr_BE.IBM-1252
fr_BE.ISO8859-1
fr_BE
fr_CA.8859-15
fr_CA.ISO8859-1
fr_CA.UTF-8
fr_CA
fr_CH.8859-15
fr_CH.ISO8859-1
fr_CH
fr_FR.UTF-8
fr_LU.8859-15@euro
fr_LU.8859-15@preeuro
fr_LU.8859-15
fr_LU@euro
fr_LU@preeuro
fr_LU

But when I read the xml file still the same error.

 teamaix(itftp): /app/user/itftp -> grep Andr F18GRAD014.xml
<FirstName>Andr�e</FirstName>---->This one
<FirstName>Andrew</FirstName>

I'm confused by what you have shown us.
Setting these locale environment variables in the .profile file of the user itftp will not affect the output you see when you run commands in your shell when you are logged in as you. Try running the following commands in your shell, and tell us what happens:

( unset LC_ALL
LANG=en.US.UTF-8
LC_CTYPE=fr_FR.UTF-8
grep Andr F18GRAD014.xml
)

(Note that the parentheses put all of these commands in a subshell environment. The locale environment variables outside of this subshell will not be affected. So, if it doesn't work, you haven't modified your current shell execution environment.

If it does work, you can decide whether you want to make make the changes I suggested to your .profile file, log out, and login again so all future commands you run will be using these locale settings or if you want to type in these commands only when you run certain commands (like this grep ) in the future.