http://www.perlmonks.org?node_id=1201487


in reply to Re: XML::Smart - undesired decoding of special XML characters
in thread XML::Smart - undesired decoding of special XML characters

Hi, Thank you very much for your solution. It seems to work. It runs succesful through a short test. I guess the code does the following:

The internal subroutine _data_type of the module XML::Smart is used to determine if the content of an XML element should be treated as binary data. Everytime when the subroutine returns the value 2 (data type binary), the return value will set to the new value 4 (data type content, i.e. no binary data). So XML::Smart never uses Base64 Encoding. Is this explanation correct?

  • Comment on Re^2: XML::Smart - undesired decoding of special XML characters

Replies are listed 'Best First'.
Re^3: XML::Smart - undesired decoding of special XML characters
by Your Mother (Bishop) on Oct 17, 2017 at 12:37 UTC

    Almost. 4 is binary which is switched to 2, content, and anything else is passed through as is.

    Even if it works for you, I think you should be looking for alternatives in your XML handling.

    Update: and I'm not positive XML::Smart can't do this correctly. Someone might be able to get it to work for you. I just couldn't get it to, passed it encoded and decoded UTF-8 and it turned both into the binary encoding.