php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #23292 xml_parse / xml_parser_create does not use (input) encoding from XML header
Submitted: 2003-04-20 21:10 UTC Modified: 2003-05-14 05:34 UTC
From: adam at indexdata dot dk Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.3.2RC1 OS: Linux 2.4.19
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: adam at indexdata dot dk
New email:
PHP Version: OS:

 

 [2003-04-20 21:10 UTC] adam at indexdata dot dk
xml_parse / xml_parser_create does not
use (input) encoding from XML header even though 
EXPAT supports that feature. If xml_parser_create
is called with with no arguments, XML file
is assumed to be of type ISO-8859-1 (default_encoding).

It would be desirable if there was a way to
make PHP call EXPAT's XML_ParserCreate(encoding)
with encoding == NULL
to force EXPAT to perform the proper character set
conversion to output character set (TARGET_ENCODING).

Inspecting source from latest PHP, suggests that
this applies to many PHP versions.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-20 21:38 UTC] dickmeiss@php.net
For test case see
 http://dickmeiss.net/23292/
 [2003-05-14 05:34 UTC] dickmeiss@php.net
Fixed in PHP5 CVS. Specify "" for encoding
in xml_parser_create to achieve proper character set
decoding.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 15 05:01:33 2025 UTC