Jump to content

Archived

This topic is now archived and is closed to further replies.

Collin

Character encoding problem

Recommended Posts

I have an xml file and all goes well when loading it, until I use "special characters" as é, è, à,... There I get the error: [b]Input is not proper UTF-8, indicate encoding.[/b] And in the xml file I find a "?" where there should be an é, è or à.

In the xml file I have the declaration: [b]<?xml version="1.0" encoding="ISO-8859-1"?>[/b] so what do I need to do to get these "special characters" in my xml file, if his declaration doesn't say to php "use this character set"?

I have searched for an answer, but I just don't understand what they're saying about encoding and stuff...

Help please! :-(

Share this post


Link to post
Share on other sites
[!--quoteo(post=355686:date=Mar 16 2006, 09:42 PM:name=Collin)--][div class=\'quotetop\']QUOTE(Collin @ Mar 16 2006, 09:42 PM) [snapback]355686[/snapback][/div][div class=\'quotemain\'][!--quotec--]
I have an xml file and all goes well when loading it, until I use "special characters" as é, è, à,... There I get the error: [b]Input is not proper UTF-8, indicate encoding.[/b] And in the xml file I find a "?" where there should be an é, è or à.

In the xml file I have the declaration: [b]<?xml version="1.0" encoding="ISO-8859-1"?>[/b] so what do I need to do to get these "special characters" in my xml file, if his declaration doesn't say to php "use this character set"?

I have searched for an answer, but I just don't understand what they're saying about encoding and stuff...

Help please! :-(
[/quote]

These functions are enabled by default, using the bundled expat library. You can disable XML support with --disable-xml. If you compile PHP as a module for Apache 1.3.9 or later, PHP will automatically use the bundled expat library from Apache. In order you don't want to use the bundled expat library configure PHP --with-expat-dir=DIR, where DIR should point to the base installation directory of expat.

The windows version of PHP has built in support for this extension. You do not need to load any additional extension in order to use these functions.


You can find a group of funtions to convert and use xml to anarray at www.php-xmla.zonapersonal.com

Share this post


Link to post
Share on other sites
I don't have access to the server, so compiling PHP in not really an option...

And I have made all the stuff to be able to edit this xml file (which holds the tree for navigation on my site), so I don't want to use this xml file as an array. I just want to be able to save these special characters in my xml file without triggering an error. I've tried some stuff with htmlentities() and utf8_decode(), but I have no idea what i'm doing, and why...

I just use the DomDocument->load() and DomDocument->save() methods, so I guess I just need to encode/decode the xml file before/after loading/saving... But I don't understand why I get an "not proper utf-8" error when I'm using an ISO character set... I've also tried setting it as an utf-8 xml file, but to no avail...

edit: I forgot to mention that I get the input for changing anything in my xml file through a form (a textbox).

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.