UTF-8 Woes


In my FYP project, we have to deal with UTF-8 encoded data. Database was set to utf-8 charset by the client’s database developer. My localhost server was set to utf-8 as well. But the display would come out grabbled text. 

So text like, 동방신기 will appear like ë™ë°©ì‹ ê¸°. 

So what went wrong? To be frank I have no idea. This gotten fixed when I input the first line into my .htaccess script:

AddDefaultCharset UTF-8
RewriteEngine on
RewriteCond $1 !^(index.php|images|assets|user_guide|robots.txt)
RewriteRule ^(.*)$ /fyp/index.php/$1 [L]

So now, I can move on coding the web service proper.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.