Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-12-2008, 02:20 PM   PM User | #1
n00ge
New Coder

 
Join Date: Jun 2005
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
n00ge is an unknown quantity at this point
Issues saving xml as UTF8

I'm running into some problems w/ UTF-8 encoding on a XML file. I'm getting some values from my db (that is all stored as UTF-8) and creating an XML file from it. I have tried a few different variations and am getting nowhere. My end goal is to have the text render correctly in Flash (instead of gettting the box characters). I know it's working correctly on the Flash side because if I save the same XML file w/ my text editor with UTF-8 encoding it renders correctly. Here's some code I'm using with some comments mixed in from different variations of my attempts.

PHP Code:
$exporttext "some text w/ special characters like ™";
$enctype iconv_get_encoding($exporttext);
//$exporttext = iconv($enctype, "UTF-8", $exporttext);
$fh fopen($myFile'w') or die("can't open file");
//$exporttext="\xEF\xBB\xBF".$exporttext; 
fputs($fh,utf8_encode($exporttext));
fclose($fh); 
Any ideas would be appreciated. Thanks.
n00ge is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:52 AM.


Advertisement
Log in to turn off these ads.