#31909 [Opn->Bgs]: can't support gb2312 charset

From: Date: Thu, 10 Feb 2005 08:51:04 +0000
Subject: #31909 [Opn->Bgs]: can't support gb2312 charset
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-73738@lists.php.net to get a copy of this message
ID: 31909 Updated by: chregu@php.net Reported By: misnet at hotmail dot com -Status: Open +Status: Bogus Bug Type: DOM XML related Operating System: windows server 2003 PHP Version: 5.0.3 New Comment: Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Thank you for your interest in PHP. Input always has to be utf-8, for example for createElement() (only exceptions are load() and loadXML()). You have to convert that to UTF-8 before putting it into dom. The second parameter of the constructor is for the output encoding. Previous Comments: ------------------------------------------------------------------------ [2005-02-10 03:53:42] misnet at hotmail dot com Description: ------------ $dom = new DOMDocument("1.0","gb2312"); $rootElement = $dom->createElement("Article"); $rootElement->appendChild($dom->createElement("Title",$title); echo $dom->saveXML(); ------------------ Run result is wrong! If "$title" is utf-8 code, it can be right! In the DOMDocument construction, I use gb2312 charset,the $title should be gb2312 code.But in the fact, I have to use utf-8,otherwise it will be wrong! why? ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=31909&edit=1

« previous php.bugs (#73738) next »