nataraj: (Default)
[personal profile] nataraj
use strict;
use XML::LibXML;
use utf8;
binmode(STDOUT, ":utf8");


my $dom = XML::LibXML::Document->new(1.0,'utf-8');
my $root = $dom->createElement('book');
$dom->setDocumentElement($root);
$root->setAttribute('test',  "А...Я");
$root->appendText('Еще что-то по русски');

my $xml = $dom->toString();

print $xml;
Как вы думаете, что она выводит? Вот что:
<?xml version="1" encoding="utf-8"?>
<book test="Ð...Я">ÐÑе ÑÑо-Ñо по ÑÑÑÑки</book>

Патаму что у $xml не выставлен флаг UTF8, блядь!
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

Profile

nataraj: (Default)
Swami Dhyan Nataraj

July 2024

S M T W T F S
 123456
789 10111213
14151617181920
21222324252627
28293031   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 22nd, 2026 01:47 am
Powered by Dreamwidth Studios