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


in reply to Perl converting some html entities when I don't want it to

Great - thanks for the help, both.

I am not using an XML writer, which is probably the root of the problem...I am using print.

I have the line print "$key_attrbs=\"$attrbs{$key_attrbs}\""; in a loop of the node to print out all its attributes.

I have now added above it: encode_entities $attrbs{$key_attrbs};, which seems to have done the trick.(with use HTML::Entities at the beginning)

I suspect this is not ideal, but it's working for me at the moment

Thanks a lot for the help

MorayJ

Replies are listed 'Best First'.
Re^2: Perl converting some html entities when I don't want it to
by MorayJ (Beadle) on Sep 13, 2012 at 13:44 UTC

    ...although I would add, for other unwary travelers, that as it's html entities, it is converting things like the £ sign to £, which means the xml import still fails on that as it needs warning that you're going to be doing that.

    All in all, will be better in the long run to use an xml writer, though this works as a fix

    Thanks again