php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64719 simplexml not show farsi or arabic
Submitted: 2013-04-26 09:04 UTC Modified: 2013-04-26 10:02 UTC
From: hooman6445 at gmail dot com Assigned:
Status: Not a bug Package: SimpleXML related
PHP Version: 5.4.14 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: hooman6445 at gmail dot com
New email:
PHP Version: OS:

 

 [2013-04-26 09:04 UTC] hooman6445 at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.simplexml-load-file#refsect1-
function.simplexml-load-file-examples
---


Test script:
---------------
<?php
$xmlstring = <<<XML
<?xml version="1.0" encoding="ISO-8859-1"?>
<note>
<to>هومن</to>
<from>من</from>
<heading>باگ</heading>
<body>این فارسی یا عربی ساپرت نمیکنه.</body>
</note>
XML;

$xml = simplexml_load_string($xmlstring);

var_dump($xml);
?>

Expected result:
----------------
object(SimpleXMLElement)[1]
  public 'to' => string 'هومن' (length=16)
  public 'from' => string 'من' (length=8)
  public 'heading' => string 'باگ' (length=12)
  public 'body' => string 'این فارسی یا عربی ساپرت نمیکنه.' (length=106)

Actual result:
--------------
object(SimpleXMLElement)[1]
  public 'to' => string 'هومن' (length=16)
  public 'from' => string 'من' (length=8)
  public 'heading' => string 'باگ' (length=12)
  public 'body' => string 'این فارسی یا عØÂ
±Ã˜Â¨Ã›ÂŒ ساپرت نمیکنه.' (length=106)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-04-26 10:02 UTC] johannes@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

ISO-8859-1 doesn't contain و and similar characters. Probably you have to set the file's encoding to utf-8.
 [2013-04-26 10:02 UTC] johannes@php.net
-Status: Open +Status: Not a bug
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri Dec 09 03:03:42 2022 UTC