| | |
how to tell php to set into Utf-8?
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jul 2008
Posts: 39
Reputation:
Solved Threads: 0
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.
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.
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.
![]() |
Similar Threads
- IE7 document.getElementById problem (JavaScript / DHTML / AJAX)
- http connection in j2me (Java)
- Open In New Window Php (PHP)
- serious problem..in online examination ..plz solve that as soon as possible (JavaScript / DHTML / AJAX)
- "Forbidden / You don't have permission to access / on this server." error (Linux Servers and Apache)
- Email problem in php. Plz help me (PHP)
- Coding a PvP Arena - Help (PHP)
- php counter (PHP)
Other Threads in the PHP Forum
- Previous Thread: Page Searcher
- Next Thread: Indenting text within PHP
Views: 541 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic echo email encode error file files folder form forms function functions google howtowriteathesis href htaccess html image include insert integration ip java javascript joomla jquery limit link login loop mail menu methods mlm mod_rewrite multiple multipletables mysql oop parse paypal pdf php problem provider query radio random recursion regex remote script search select server sessions sms soap source space speed sql structure syntax system table template tutorial update updates upload url validation validator variable video web xml youtube






