| | |
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
| Thread Tools | Search this Thread |
.htaccess ajax apache api array beginner binary broken buttons cakephp checkbox class cms code cron curl database date directory display download dynamic ebooks echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla limit link login loop mail mediawiki menu mlm mod_rewrite multiple mysql number oop paypal pdf php phpincludeissue phpmyadmin problem query radio random recursion regex remote script search server sessions sms soap source sp space speed sql subdomain syntax system table tag tutorial update upload url validation validator variable vbulletin video web websphere white xml youtube






