Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Why am I not seeing Japanese in my web page on my Android? [NOT SOLVED]



> After I adjusted the meta tags as described in my last post, I was
> seeing kanji being displayed, and thought everything was hunky dory.
> 
> However, I continued using the interface a bit, and discovered that
> after JSON data had been sent to and from the phone, the kanji got
> mangled back to the ASCII string as described before.
> ...

Could it be the JSON is sending an HTTP header that says a different
encoding?

I'm assuming you are using apache and php. IIRC, the way they work
together is if the PHP script sets the Content-Type header then Apache
does not touch it. However if the PHP script does not set one then
Apache will add its default. (And if Apache has been setup with no
default then it sends nothing.)

A meta-tag should override the http header.

So, at the top of your PHP script that processes the ajax request, try
adding:
  header('Content-Type: application/json; charset=UTF-8');

(If using an ajax library, or a framework, it is first have a search
through to see if there is already a Content-Type or encoding setting.)

Darren


-- 
Darren Cook, Software Researcher/Developer

http://dcook.org/work/ (About me and my work)
http://dcook.org/blogs.html (My blogs and articles)


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links