timhart Posted November 24, 2006 Share Posted November 24, 2006 I have a problem with a system that I have taken over. I would really appreciate one of you kind folks showing me where the problems are and possible solutions. All of the data is read from the database and transfered as XML.I have to allow multi language support so I have converted the mysql database to UTF-8.When users copy and paste (especially from MS Word) text into the input fields it is converted using utf8_encode($str) and as an example a curly version of the apostrophe ends up being stored in the database as €Â™ (is this correct???).After looking at a post on here I started using the htmlentites parameters in the file that creates the xml so this looks like this $xml .= htmlentities($str, ENT_QUOTES,'UTF-8'); After building the $xml string it gets put through the $xml = mb_convert_encoding($xml,"UTF-8","auto");Then the page that calls the xml (via curl) uses $obs = simplexml_load_string($store);and this is the line that errors.Any ideas would be greatly appreciated as I am truly stuckThanks Link to comment https://forums.phpfreaks.com/topic/28317-utf8-problems/ Share on other sites More sharing options...
printf Posted November 24, 2006 Share Posted November 24, 2006 What are using for the database utf8_? Are you setting the database to return utf8 encoding? Just because you use utf8, does not mean the data is returned to your script in that state, you have to tell the database after you open the connection that utf8 encoding needs to be passed via the socket stream, if you don't it will never be returned correctly. Show me the code that shows how your connecting.printf Link to comment https://forums.phpfreaks.com/topic/28317-utf8-problems/#findComment-129623 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.