Linux ns1.utparral.edu.mx 6.8.0-79-generic #79~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 15 16:54:53 UTC 2 x86_64
Apache/2.4.58 (Unix) OpenSSL/1.1.1w PHP/8.2.12 mod_perl/2.0.12 Perl/v5.34.1
: 10.10.1.9 | : 10.10.1.254
Cant Read [ /etc/named.conf ]
daemon
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
README
+ Create Folder
+ Create File
/
opt /
lampp /
lib /
php /
test /
XML_Parser /
tests /
[ HOME SHELL ]
Name
Size
Permission
Action
001.phpt
1.28
KB
-rw-r--r--
002.phpt
1.29
KB
-rw-r--r--
003.phpt
1.36
KB
-rw-r--r--
004b.phpt
695
B
-rw-r--r--
004.phpt
694
B
-rw-r--r--
005.phpt
2.26
KB
-rw-r--r--
AllTests.php
3.57
KB
-rw-r--r--
bug-9328b.phpt
911
B
-rw-r--r--
bug-9328c.phpt
914
B
-rw-r--r--
bug-9328d.phpt
872
B
-rw-r--r--
bug-9328.phpt
836
B
-rw-r--r--
test2.xml
39
B
-rw-r--r--
test3.xml
39
B
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : 005.phpt
--TEST-- XML Parser: mixing character encodings --SKIPIF-- <?php if (true) { print 'skip - incomplete test!'; } if (!extension_loaded('xml')) { print 'skip - xml extension not available'; } if (!extension_loaded('mbstring')) { print 'skip - mbstring extension not available'; } ?> --FILE-- <?php /* Test for: XML/Parser.php * Parts tested: - mixing character encodings * * This is what we test: * 1 UTF-8 -> ISO-8859-1 * 2 UTF-8 -> US-ASCII * 3 ISO-8859-1 -> UTF-8 * 4 ISO-8859-1 -> US-ASCII * 5 US-ASCII -> UTF-8 * 6 US-ASCII -> ISO-8859-1 */ require_once 'XML/Parser.php'; class TestEncodings1 extends XML_Parser { var $output = ''; function TestEncodings1($to, $mode, $from) { $this->XML_Parser($from, $mode, $to); } function startHandler($xp, $elem, $attribs) { $this->output .= "<$elem>"; } function endHandler($xp, $elem) { $this->output .= "</$elem>"; } function cdataHandler($xp, $data) { $this->output .= $data; } function test($data) { $result = $this->parseString($data, true); if (PEAR::isError($result)) { return $result; } } } $xml = "<?xml version='1.0' ?>"; $input = array( "UTF-8" => "<a>abcæøå</a>", /* are these special chars allowed in ISO-8859-1 context??? */ "ISO-8859-1" => "<a>abc���</a>", // "ISO-8859-1" => "<a>abc�<a>", "US-ASCII" => "<a>abcaoa</a>" ); $encodings = array_keys($input); foreach ($input as $srcenc => $string) { foreach ($encodings as $tgtenc) { if ($srcenc == $tgtenc) { continue; } print "Testing $srcenc -> $tgtenc: "; $p =& new TestEncodings1($tgtenc, 'event', $srcenc); $e = $p->test($input[$srcenc]); if (PEAR::isError($e)) { printf("OOPS: %s\n", $e->getMessage()); } else { var_dump($p->output); } } } ?> --EXPECT-- Testing UTF-8 -> ISO-8859-1: string(13) "<A>abc���</A>" Testing UTF-8 -> US-ASCII: string(13) "<A>abc???</A>" Testing ISO-8859-1 -> UTF-8: string(16) "<A>abcæøå</A>" Testing ISO-8859-1 -> US-ASCII: string(13) "<A>abc???</A>" Testing US-ASCII -> UTF-8: string(13) "<A>abcaoa</A>" Testing US-ASCII -> ISO-8859-1: string(13) "<A>abcaoa</A>"
Close