[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Parsing XML with special characters (Perl XML::Parser)

  • To: <guadalteba@h...>, <xml-dev@l...>
  • Subject: RE: Parsing XML with special characters (Perl XML::Parser)
  • From: <Ari.Nordstrom@s...>
  • Date: Thu, 27 Nov 2003 09:25:05 +0100
  • Thread-index: AcO0v/UgBY/9e3fDQ52P8O8PQiBKkw==
  • Thread-topic: Parsing XML with special characters (Perl XML::Parser)

special characters in xml
Carlos Prim wrote...

> Hello.
> 
> I'm trying to parse some remote XML files, but they include
> Spanish special characters. I work on Linux, with Perl and
> 'XML::Parser' module (downloaded from CPAN).
> 
> But I have some problems with the characters, as I get 
> 'año' instead of 'año', or 'práctico' instead of
> 'práctico'.
> 
> I tried with 'Text::Iconv' and 'Unicode::MapUTF8' Perl 
> modules, but -I don't know if I do it wrong- it does not
> work
> correctly (texts do not change).
> 
> I do not know if I should install another module on my Linux
> machine, or if it works really with 'Unicode::MapUTF8'.
> 
> Does anybody have any experience? Thank you very much.


This sounds a bit like a problem a colleague encountered recently. This was on a Windows (2k) box but my guess is that something similar would happen in Linux. I'm not familiar with the modules you mention, however.

Are you using Perl 5.8? It's supposed to have better handling of UTF-8 but my experience is that unless you're using the "use utf8" pragma, you're likely to mess up non-ASCII characters anyway. Do a Google search; people have lots of problems with Perl and UTF-8, the UTF-8 support is far from perfect.

I also got varying results depending on the tools I tried. For example, different versions of the Komodo IDE gave different results, not just when displaying the characters. The bytecodes were messed up.

Best,

/Ari

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.