Unix/Linux Go Back    


AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

French Accented characters in xml file comes as numbers

AIX


Reply    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 12-14-2017   -   Original Discussion by pregmi
pregmi's Unix or Linux Image
pregmi pregmi is offline
Registered User
 
Join Date: Mar 2009
Last Activity: 2 April 2018, 11:34 AM EDT
Posts: 8
Thanks: 1
Thanked 0 Times in 0 Posts
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

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

Thank you

Last edited by rbatte1; 12-15-2017 at 07:40 AM.. Reason: Added CODE tags
Sponsored Links
    #2  
Old Unix and Linux 12-14-2017   -   Original Discussion by pregmi
Don Cragun's Unix or Linux Image
Don Cragun Don Cragun is online now Forum Staff  
Administrator
 
Join Date: Jul 2012
Last Activity: 21 May 2018, 1:01 AM EDT
Location: San Jose, CA, USA
Posts: 11,295
Thanks: 633
Thanked 3,929 Times in 3,364 Posts
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:


Code:
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.
The Following User Says Thank You to Don Cragun For This Useful Post:
pregmi (12-14-2017)
Sponsored Links
    #3  
Old Unix and Linux 12-14-2017   -   Original Discussion by pregmi
pregmi's Unix or Linux Image
pregmi pregmi is offline
Registered User
 
Join Date: Mar 2009
Last Activity: 2 April 2018, 11:34 AM EDT
Posts: 8
Thanks: 1
Thanked 0 Times in 0 Posts
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?

Last edited by rbatte1; 12-15-2017 at 07:41 AM.. Reason: Added ICODE tags
    #4  
Old Unix and Linux 12-15-2017   -   Original Discussion by pregmi
Don Cragun's Unix or Linux Image
Don Cragun Don Cragun is online now Forum Staff  
Administrator
 
Join Date: Jul 2012
Last Activity: 21 May 2018, 1:01 AM EDT
Location: San Jose, CA, USA
Posts: 11,295
Thanks: 633
Thanked 3,929 Times in 3,364 Posts
Quote:
Originally Posted by pregmi View Post
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.
Sponsored Links
    #5  
Old Unix and Linux 12-15-2017   -   Original Discussion by pregmi
pregmi's Unix or Linux Image
pregmi pregmi is offline
Registered User
 
Join Date: Mar 2009
Last Activity: 2 April 2018, 11:34 AM EDT
Posts: 8
Thanks: 1
Thanked 0 Times in 0 Posts
Still the same problem Don. I have the locales loaded and I have this on itftp .profile



Code:
 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.



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

Moderator's Comments:
French Accented characters in xml file comes as numbers Please use CODE tags when displaying sample input, output, and code segments as required by forum rules.

Last edited by Don Cragun; 12-15-2017 at 12:36 PM.. Reason: Add CODE tags.
Sponsored Links
    #6  
Old Unix and Linux 12-15-2017   -   Original Discussion by pregmi
Don Cragun's Unix or Linux Image
Don Cragun Don Cragun is online now Forum Staff  
Administrator
 
Join Date: Jul 2012
Last Activity: 21 May 2018, 1:01 AM EDT
Location: San Jose, CA, USA
Posts: 11,295
Thanks: 633
Thanked 3,929 Times in 3,364 Posts
Quote:
Originally Posted by pregmi View Post
Still the same problem Don. I have the locales loaded and I have this on itftp .profile



Code:
 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.



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

Moderator's Comments:
French Accented characters in xml file comes as numbers Please use CODE tags when displaying sample input, output, and code segments as required by forum rules.
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:


Code:
( 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.
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
French characters in postfix/sendmail galford UNIX for Dummies Questions & Answers 1 09-04-2014 08:35 AM
Find out special characters from xml file Krishanu Saha Shell Programming and Scripting 10 04-26-2013 03:01 PM
Help with escaping xml characters in a file prasannarajesh Shell Programming and Scripting 5 02-08-2011 05:59 AM
Problems with French Characters Redfin HP-UX 3 12-12-2008 05:59 PM
Replacing French special characters BlueberryPickle Shell Programming and Scripting 4 07-24-2008 02:05 AM



All times are GMT -4. The time now is 01:03 AM.