Hi, I have a problem while using any national charsets and handling XML's with XML::DOM. Let's see some program: ############################################# <%init> use XML::DOM;
print "ббб\n"; # Someone in non-english charset my $s = '<?xml version="1.0" encoding="windows-1251"?><TOVAR></TOVAR>'; my $parser = new XML::DOM::Parser; my $doc = $parser->parse($s); my $root = $doc->getDocumentElement(); my $a = $root->getTagName(); # print $a if ($a eq 'TOVAR'); # !!! THE REAL MAGIC HERE !!! </%init> <%flags> inherit => undef </%flags> ############################################## Server answer: -------------------------------------------------------------------------------- [EMAIL PROTECTED]:~]$ telnet xxxxx.ru 80 Trying xx.xx.xx.xx... Connected to xxxxx.ru. Escape character is '^]'. GET /test.html HTTP/1.1 Host: xxxxx.ru HTTP/1.1 200 OK Date: Tue, 18 Mar 2008 13:50:42 GMT Server: Apache/1.3.37 (Unix) mod_perl/1.30 PHP/5.2.3 with Suhosin-Patch Pragma: no-cache Cache-control: no-cache Expires: Thu, 01 Jan 1970 00:00:01 GMT Transfer-Encoding: chunked Content-Type: text/html; charset=windows-1251 Content-Language: ru 4 ббб <- All looks fine !!! 0 Connection closed by foreign host. [EMAIL PROTECTED]:~]$ -------------------------------------------------------------------------------- Now remove remark char (#) before last print. Server answer: -------------------------------------------------------------------------------- [EMAIL PROTECTED]:~]$ telnet xxxxx.ru 80 Trying xx.xx.xx.xx... Connected to xxxxx.ru. Escape character is '^]'. GET /test.html HTTP/1.1 Host: xxxxx.ru HTTP/1.1 200 OK Date: Tue, 18 Mar 2008 13:57:47 GMT Server: Apache/1.3.37 (Unix) mod_perl/1.30 PHP/5.2.3 with Suhosin-Patch Pragma: no-cache Cache-control: no-cache Expires: Thu, 01 Jan 1970 00:00:01 GMT Transfer-Encoding: chunked Content-Type: text/html; charset=windows-1251 Content-Language: ru c ццц <- Broken characters !!! TOVAR 0 Connection closed by foreign host. [EMAIL PROTECTED]:~]$ -------------------------------------------------------------------------------- Whats may be wrong? How to solve? (Program works right under plain mod-perl.) -------------------------------------------------------------------------------- [EMAIL PROTECTED]:~]$ pkg_info | grep Mason bsdpan-Syntax-Highlight-Mason-1.21 Syntax::Highlight::Mason - Perl extension to Highlight HTML p5-HTML-Mason-1.35 High-performance, dynamic web site authoring system [EMAIL PROTECTED]:~]$ pkg_info | grep apache apache-1.3.37_4 The extremely popular Apache http server. Very fast, very c [EMAIL PROTECTED]:~]$ perl -v This is perl, v5.8.8 built for i386-freebsd-64int -------------------------------------------------------------------------------- Thanks! -- Konstantin Stroikovski ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users