Operating System - HP-UX
1830227 Members
2238 Online
109999 Solutions
New Discussion

How to encode umlauts in XML files using perl ??????

 
Henrique Silva_4
New Member

How to encode umlauts in XML files using perl ??????

I am using HP OV Service Desk and need to automate the process of entering person records.

OVSD uses XML files as input for the data. I have designed a process that created this XML files, so that I can automate the process, since, it can not be done via the GUI, however, when using input text files that contain umlauts, the umlaut is not encoded on the XML file, and the XML parser breaks the file apart, since it can not match
SOMETHING tags.
For instance, I have a word such as XX-Ã S
( XX-umlaut OS )

The proper formatting of the line on the good XML file is, realised via teh GUI is :


XX-M-CM-^VS


When I format the same file via the perl script, I get :


XX-Ã S


which breaks the parser.

The error is something like this :


XX-


which I can see, is telling the parser that the XML strucutre is not sound.

I am not using and SAX modules or any other perl modules at all on this perl script. The XML structure is VERY simple to recreate, so, I did not need to make this a complicated script. However, I am missing HOW to encode these umlauts in the naked XML file, as you can see how the GUI does on the first example.

Have anyone dealt with this before ? What should I do here ? How do I find out ALL the available umlauts on various languages ? And how do I identify them, so that I can put the proper encoding in place on the XML file ?

I would appreciate any help here. Maybe you can push me in the right direction.

Thanks,

Henrique Sil
1 REPLY 1
Rick Beldin
HPE Pro

Re: How to encode umlauts in XML files using perl ??????

I would probably investigate how to use locales from within Perl. You might be running into a problem when perl tries to encode the character using the default C (posix) locale, which does not have support for internationalized characters.

Perhaps this would be a good starting point for some research:

http://www.perldoc.com/perl5.6/pod/perllocale.html
Necessary questions: Why? What? How? When?