Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

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

by Anonymous Monk
on Sep 16, 2013 at 11:05 UTC ( #1054277=note: print w/replies, xml ) Need Help??

in reply to XML::Twig modify data, and I don't want that


thats called an "entity" so perldoc XML::Twig | grep entity


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

Replies are listed 'Best First'.
Re^2: XML::Twig modify data, and I don't want that (preserve entities keep_encoding)
by physi (Friar) on Sep 16, 2013 at 11:56 UTC
    Thanks, but I can't figure out, how this helps?
    Or is the short answer: "It's not possible!" ?
    --the good, the bad and the 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.


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

        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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1054277]
[oiskuu]: I'm unfamiliar with android or SELinux. But I believe there is nothing of a kind. Unless you play with capabilities or build your own containers/ namespaces.
[davido]: I am not finding closing STDIN to be an adequate means of making getlogin return undef.
[Corion]: Maybe doing a double-fork (daemonizing) can make go that information away, but maybe not

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2017-06-23 19:30 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (554 votes). Check out past polls.