943,580 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 723
  • PHP RSS
Aug 15th, 2008
0

how to tell php to set into Utf-8?

Expand Post »
hi all;

i was creating a function to tell the php to set into Utf-8, but i got a problem wiht it. Im looking for a good resource of code that tell the php to set only a Utf-8,

here is sample code.


if (!mb_internal_encoding("UTF-8"))
die("Cannot set encoding to UTF-8 in common<n>.php");
if (!mb_http_output("UTF-8"))
die("Cannot set encoding to UTF-8 in common<n>.php");
Quote
can anyone help me to make this code work's, thanks for advance.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
god_1896 is offline Offline
39 posts
since Jul 2008
Aug 15th, 2008
0

Re: how to tell php to set into Utf-8?

As of PHP 5 I dont think there is anyway to do this. PHP 6 is supposed to have better support for UTF-8.

What you can try doing, is everywhere you output to the page, encode it to UTF-8 using uft8encode(). And in the actual HTML markup, use html escape sequences for special characters &#xxx;

Hope this helps.
Featured Poster
Reputation Points: 975
Solved Threads: 140
Posting Virtuoso
scru is offline Offline
1,624 posts
since Feb 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Page Searcher
Next Thread in PHP Forum Timeline: Indenting text within PHP





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC