php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59792 Trouble with saveFile
Submitted: 2011-05-29 20:39 UTC Modified: 2014-12-30 10:41 UTC
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: ugokanain at newsguy dot com Assigned:
Status: No Feedback Package: SCA_SDO (PECL)
PHP Version: 5.3.5 OS: OS X 10.5.8
Private report: No CVE-ID: None
View Add Comment Developer Edit
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 — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
7 + 10 = ?
Subscribe to this entry?

 
 [2011-05-29 20:39 UTC] ugokanain at newsguy dot com
Description:
------------
When using saveFile to save UTF8 data, the multibyte 
representation gets stored. For instance when saving M?xico 
it gets stored as México (the éis the proper 
unicode value for ?). The correct character displayed with 
var_dump, so the data itself is correct. 

I rather use SDO_DAS_XML since I have a xds schema. Is there 
any way to store the data using a SDO call or at least 
export into another XML utility so that it can be saved. 

Since I got your attention, how do I change the namespace so 
that it displays as "<cdfi:" rather than the actual "<tns:"

The var_dump displays:
object(SDO_DataObjectImpl)#4 (1) { ["Emisor"]=> 
object(SDO_DataObjectImpl)#5 (1) { ["DomicilioFiscal"]=> 
object(SDO_DataObjectImpl)#6 (1) { ["pais"]=> string(7) 
"M?xico" } } }

Reproduce code:
---------------
In an included file I have:
mb_internal_encoding("UTF-8");
mb_regex_encoding("UTF-8");
mb_http_output("UTF-8");
mb_language("uni");


The code is:
$xmldas = SDO_DAS_XML::create("ftp://ftp2.sat.gob.mx/asistencia_servicio_ftp/publicaciones/solcedi/cfdv3.xsd","cfdi");

$doc = $xmldas->createDocument();
$doc->setEncoding("utf8");
$doc->setXMLDeclaration(true);
$rdo = $doc->getRootDataObject();
$entidad = $rdo->createDataObject("Emisor");
$domFiscal = $entidad->createDataObject("DomicilioFiscal");
$domFiscal->pais = "M?xico";
$xmldas->saveFile($doc,'blog.xml',2);
	 
var_dump($rdo);

Expected result:
----------------
<tns:DomicilioFiscal pais="M?xico"/>



Actual result:
--------------
<tns:DomicilioFiscal pais="M&#xE9;xico"/>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-07-15 22:32 UTC] yohgaki@php.net
-Status: Open +Status: Feedback
 [2014-07-15 22:32 UTC] yohgaki@php.net
It seems report text is removed. Please add description if you have issue.
 [2014-12-30 10:41 UTC] pecl-dev at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 15:01:56 2024 UTC