简体   繁体   中英

PHP backend for Android / Iphone - Special character issue

We are using PHP as backend for mobile application (in both Android and IPhone). From mobile we will hit the backend to get the record listings in xml format (same for both android and iphone) from php.

We have special characters in the database in some fields (swedish characters). From mobile we will pass the search text which user keys in and display the records accordingly. So first we tested from iphone, there was some characters not displayed properly and then we changed charset to UTF-8 in mysql_charset. After that it was working fine in IPhone. But there was problem in retreiving records from Android. When we input text which has special characters, then the expected result was not displayed. But when we search from the browser , results are displayed normally.

We have used the xmlencoding as utf-8 also added 'header('Content-Type: text/xml; charset=utf8'); '

If there is any other solution compatible for both Iphone and Android, please let me know.

Characters which we will be using are ä, å, é, ö.

Thanks in Advance,

Regards

Srini

on this website you find all HEX codes of every special character. http://www.ascii.cl/htmlcodes.htm

In Android (Java) you display special characters like this view.setText("hello\!"); for hello!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM