how to tell php to set into Utf-8?

Reply

Join Date: Jul 2008
Posts: 39
Reputation: god_1896 is an unknown quantity at this point 
Solved Threads: 0
god_1896 god_1896 is offline Offline
Light Poster

how to tell php to set into Utf-8?

 
0
  #1
Aug 15th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 1,613
Reputation: scru has a spectacular aura about scru has a spectacular aura about 
Solved Threads: 130
Featured Poster
scru's Avatar
scru scru is offline Offline
Posting Virtuoso

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

 
0
  #2
Aug 15th, 2008
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC