|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-07-15 22:32 UTC] yohgaki@php.net
-Status: Open
+Status: Feedback
[2014-07-15 22:32 UTC] yohgaki@php.net
[2014-12-30 10:41 UTC] pecl-dev at lists dot php dot net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 02:00:01 2025 UTC |
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éxico"/>