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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
35 + 6 = ?
Subscribe to this entry?

 
 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 03 20:01:30 2024 UTC