By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,043 Members | 1,153 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,043 IT Pros & Developers. It's quick & easy.

UTF-8 fwrite problem

P: n/a
Hey,

I've got a problem with utf-8 strings.

I start with getting a string from a database and when i encode it
with
utf8Encode($str) and output it to the browser (which has a utf-8
encodig), there is no problem displaying special symbols (like the
euro sign ).

But then i want to creat an xml document and write the following to a
file:

<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>
<Root>
utf8Encode($str)
</Root>
But when i open the xml file the special symbols are gone :-S.
I've tried a lot, but can't get it working.

So please help!

BTW: I'm using server with this phpinfo:
http://www.wijkkrant.nl/m_export_xml/info.php
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
AngTalunin <ws*****@gmail.com> wrote:
I start with getting a string from a database and when i encode it
with
utf8Encode($str) and output it to the browser (which has a utf-8
encodig), there is no problem displaying special symbols (like the
euro sign ?).
That is strange... According to the manual it translates an iso8859-1
string to UTF-8. And iso8859-1 doesn't have an euro symbol. Just like
the euro symbol is missing in the charset you posted this in, the ?
above is a \200 char which is illegal in iso8859-1
But then i want to creat an xml document and write the following to a
file:

<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>
<Root>
utf8Encode($str)
</Root>
Please post an URL to an example. My gues is that the http headers
(which have priority) set the encoding to something else.
BTW: I'm using server with this phpinfo:
http://www.wijkkrant.nl/m_export_xml/info.php


It appears that iconv is installed, sadly enough mstring is missing
(modules aren't loaded it seems).

Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.