php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28169 SimpleXML not parsing scandinavian characters correctly
Submitted: 2004-04-26 21:38 UTC Modified: 2004-04-26 22:03 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:1 of 2 (50.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: mikko dot nylen at pp1 dot inet dot fi Assigned:
Status: Not a bug Package: SimpleXML related
PHP Version: 5CVS-2004-04-26 (dev) OS: Gentoo Linux 2.6.5
Private report: No CVE-ID: None
 [2004-04-26 21:38 UTC] mikko dot nylen at pp1 dot inet dot fi
Description:
------------
When I'm trying to parse XML files/strings containing scandinavian characters (?, ?, ?), I just get cryptic characters.

I've tryed to set encoding-attribute to ISO-8859-1 and utf-8. I've also tryed to use ä, ä and ä in place of "?".

When I look to test.xml with Mozilla Firefox, Firefox shows the scandinavian characters correctly.

I'm using PHP 5.0.0RC2. May this be a bug?

My configure line:
------
Configure Command =>  './configure' '--prefix=/usr/local/php5' '--enable-ftp' '--enable-sockets' '--with-ncurses' '--enable-bcmath' '--with-mysql' '--with-gd' '--with-zlib' '--with-apxs=/usr/local/apache/bin/apxs' '--with-pgsql=/usr/bin/pg_config' '--with-bz2'

Reproduce code:
---------------
The XML file I'm trying to parse:
------
<?xml version="1.0" encoding="iso-8859-1"?>
<test>
  ? ? ?
</test>
?>

The PHP script I'm parsing with:
------
<?php
$xml = simplexml_load_file("test.xml");
print_r($xml);
?>

Expected result:
----------------
SimpleXMLElement Object ( [0] => ? ? ? )

Actual result:
--------------
SimpleXMLElement Object ( [0] => ä ö å )

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-26 22:03 UTC] helly@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

See #28154: Simple Xml output only utf-8
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon Oct 03 06:05:53 2022 UTC