Problem with XML::Parser and scandinavian characters 
Author Message
 Problem with XML::Parser and scandinavian characters

I have written a program using XML::Parser::PerlSAX and YAWriter to
read, filter and output an XML file.

When it runs it loses some of the scandinavian characters and I cannot
work out why. The documentation says that XML::Parser will turn
everything into utf-8, but as I understand it, anything in ISO-Latin-1
can be handled by that. So how can I get them back in the outputted XML?

JDL



Mon, 12 Apr 2004 05:53:31 GMT  
 Problem with XML::Parser and scandinavian characters
    Hi,



Quote:
> I have written a program using XML::Parser::PerlSAX and YAWriter to
> read, filter and output an XML file.

> When it runs it loses some of the scandinavian characters and I cannot
> work out why. The documentation says that XML::Parser will turn
> everything into utf-8, but as I understand it, anything in ISO-Latin-1
> can be handled by that.

    you might get two bytes instead of one, I think.

Quote:
> So how can I get them back in the outputted XML?

    you can use the Unicode::String module to convert UTF-8 to ISO-8859-1.

        use Unicode::String;

        my $utfString = "blabla";
        my $isoString = Unicode::String::utf8($utfString)->latin1();

    There are quite a lot Unicode related modules - just have a look on
CPAN...

    HTH,

        Peter



Mon, 12 Apr 2004 16:26:14 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Character encoding problem with XML::Parser

2. XML::Parser/XML::Parser::Expat

3. Problem on installing XML-Simple/XML-Parser on LynxOS

4. Installing XML-Generator / XML-Parser - make problems

5. Problem on installing XML-Simple/XML-Parser on LynxOS

6. XML::Parser Choking on Special Characters....Workaround??

7. XML::Parser extended characters

8. XML::Parser and special characters

9. XML::Parser and special characters

10. search and Scandinavian characters?

11. Parsing XML (Not XML::Parser)

12. I want to stop XML::Parser from processing CDATA tags in my XML

 

 
Powered by phpBB® Forum Software