Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: XML::Twig modify data, and I don't want that (preserve entities keep_encoding)

by roboticus (Chancellor)
on Sep 16, 2013 at 12:07 UTC ( [id://1054283]=note: print w/replies, xml ) Need Help??


in reply to Re^2: XML::Twig modify data, and I don't want that (preserve entities keep_encoding)
in thread XML::Twig modify data, and I don't want that

physi:

I believe the AM means that you can use the keep_encoding option to retain your original string data.

However, I think that the problem is that you're specifying the encoding as ISO-8859-1. If I understand properly, that means that you're telling XML::Twig that there's no Unicode data in your input. However, you have an entity in there. Since the ampersand is special, XML::Twig is properly escaping that so that when it decodes in the future, that it generates the proper output.

If you specify a unicode encoding, I expect that XML::Twig will then read the string as a unicode character, and then emit it properly when it rewrites the file.

Disclaimer: What I know about unicode you can write on a pinhead with lipstick.

...roboticus

When your only tool is a hammer, all problems look like your thumb.

  • Comment on Re^3: XML::Twig modify data, and I don't want that (preserve entities keep_encoding)

Replies are listed 'Best First'.
Re^4: XML::Twig modify data, and I don't want that (preserve entities keep_encoding)
by physi (Friar) on Sep 16, 2013 at 12:29 UTC
    Thanks roboticus.

    Same misunderstanding of unicode on my side :-)
    but even if I delete the encode line, I get the same result. I think this might be end in not using keep_encoding and then susbstitute the resulting Umlaute like ÖÄÜöäü with their encode_entities_numeric Values :-(

    -----------------------------------
    --the good, the bad and the physi--
    -----------------------------------
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1054283]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2024-04-19 12:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found