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.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.