Home » Text » Text_Wiki » Bug #7383
can not encode Multibyte String correctly with XHTML render
Details
| Submitted | 2006-04-12 18:48 UTC |
|---|---|
| From | surfchen at gmail dot com |
| Status | Bogus |
| Package | Text_Wiki |
| PHP Version | 5.1.2 |
| OS | Ubuntu |
| Roadmaps | (Not assigned) |
Comments
[2006-04-12 18:48 UTC] surfchen at gmail dot com
Description:
------------
because the Wiki::render handling the string as many one char,when there is MultiByte Character in the Input String,the Input String can not be encoding correctly.
Test script:
---------------
<?php
header("Content-Type:text/html;charset=utf8");
require_once 'Text/Wiki.php';
$chr=chr(230).chr(179).chr(189);//a Chinese Character
$str='=='.$chr.'==';
echo 'Input String:'.$str.'<br /><br />';
$parser="Mediawiki";
$wiki = & Text_Wiki::singleton($parser);
$wiki->setRenderConf('xhtml', 'code', 'css_filename', 'codefilename');
$render='Xhtml';
$mWiki = $wiki->transform($str, $render);
echo 'Output String:'.$mWiki;
?>
Expected result:
----------------
a Chinese Character(chr(230).chr(179).chr(189)) outputing as a headline..
Actual result:
--------------
some Characters which I can't reconize was printed..
[2006-04-13 15:33 UTC] surfchen at gmail dot com
it works when $wiki->setFormatConf("Xhtml","charset","utf-8");
:)thanks..
but if the Xhtml is changed to xhtml(all at lower case),it doesn't work. if the Text_Wiki::setFormatConf() can auto change the case,the package wounld be stronger,I think.