simplexml_load_file()

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jmamede
Forum Newbie
Posts: 1
Joined: Fri Feb 08, 2008 4:42 pm

simplexml_load_file()

Post by jmamede »

I am usein simplexml_load_file() to load a XML page, .... but it has latin characters and I get this message loading my page:

Warning: simplexml_load_file() [function.simplexml-load-file]: input conversion failed due to input error, bytes 0x90 0x43 0x54 0x52 in D:\xampp\htdocs\SAFT\saftpt1.php


My code for the PHP page is like this:

<?php

session_start();

$FileName = $_REQUEST["filepath"];

$AuditFile = simplexml_load_file("$FileName");

$AuditFileVersion = $AuditFile->Header->AuditFileVersion;
$CompanyID = $AuditFile->Header->CompanyID;
$TaxRegistrationNumber = $AuditFile->Header->TaxRegistrationNumber;
$TaxAccountingBasis = $AuditFile->Header->TaxAccountingBasis;


Howcan I read the XML file as UTF-8??

Thanks
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Re: simplexml_load_file()

Post by Zoxive »

http://www.google.com/search?q=input+co ... nput+error
It seems that Korean, Japanese, and other Asian pages
are especially likely to cause the error (no surprise there).
(Link)
Post Reply