#!/usr/bin/perl use strict; use XML::Twig; use Encode qw( decode ); my $twig=XML::Twig->new(pretty_print => 'indented'); $twig->parse( '<?xml version="1.0" encoding="UTF-8"?><myxml/>'); my $root= $twig->root; $root->set_att( 'fille' => decode('UTF-8', 'clémence') ); open(PF, ">", "out.xml") or die "can't open file $!\n"; $twig->print(\*PF);
In reply to Re: Lost in encoding in Twig
by Krambambuli
in thread Lost in encoding in Twig
by pcouderc
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |