开发者

PHP backend for Android / Iphone - Special character issue

开发者 https://www.devze.com 2023-04-06 06:39 出处:网络
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 ph

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\u0021"); for hello!

0

精彩评论

暂无评论...
验证码 换一张
取 消