jodaka has asked for the wisdom of the Perl Monks concerning the following question:
here $val is taken from external TXT file. Running$xp = XML::XPath->new(filename => 'config.xml'); $xp->setNodeText(qq~/conf/section[\@name="$name"]/description[\@lang=" +$lang"]~, $val);
will produce me 'это тестовая строка' - a nice UTF8 string in Russian.$xp->find(qq~/conf/section[\@name="$name"]/description[\@lang="$lang"] +~)->get_node(1)->string_value();
The problem here is in toString method. It kill my lovely UTF8 russian text... it transforms 'это тестовая строка' into сновне насойки :(open(XML, ">config.xml"); print XML $xp->find('/conf')->get_node(1)->toString; close XML;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: UTF8 issue with XML::XPath
by Corion (Patriarch) on Mar 05, 2008 at 10:33 UTC | |
by eserte (Deacon) on Mar 05, 2008 at 19:18 UTC | |
|
Re: UTF8 issue with XML::XPath
by moritz (Cardinal) on Mar 05, 2008 at 10:34 UTC | |
by jodaka (Initiate) on Mar 05, 2008 at 11:48 UTC | |
by moritz (Cardinal) on Mar 05, 2008 at 12:00 UTC | |
by jodaka (Initiate) on Mar 05, 2008 at 14:11 UTC | |
|
Re: UTF8 issue with XML::XPath
by mirod (Canon) on Mar 05, 2008 at 16:22 UTC | |
|
Re: UTF8 issue with XML::XPath
by martinovski (Initiate) on Nov 05, 2010 at 23:37 UTC | |
by ikegami (Patriarch) on Nov 08, 2010 at 17:36 UTC | |
by Anonymous Monk on Nov 06, 2010 at 04:24 UTC | |
by martinovski (Initiate) on Nov 08, 2010 at 17:05 UTC |