in reply to Re^2: help with regular expression required
in thread help with regular expression required
Since XML::Twig is writing to STDOUT, I'm not sure what your write_file is supposed to be doing...
Encodings are covered in the XML::Twig docs. Here's some code that works for me:
use warnings; use strict; use XML::Twig; open my $ofh, '>:utf8', '1097276_out.xml' or die $!; XML::Twig->new( keep_spaces => 1, twig_print_outside_roots => $ofh, twig_roots => { tu => sub { my ($twig, $elt) = @_; $elt->set_att('creationid',"Simon Sim\xF6nsen"); $elt->print($ofh); } }, )->parsefile('1097276.xml'); close $ofh;
Also have a look at the aptly-named output_encoding option in XML::Twig.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: help with regular expression required
by PitifulProgrammer (Acolyte) on Aug 18, 2014 at 15:25 UTC | |
by Anonymous Monk on Aug 18, 2014 at 15:53 UTC | |
by PitifulProgrammer (Acolyte) on Aug 19, 2014 at 09:52 UTC |