开发者

Arabic Encoding in UFT-8 from Web Service

开发者 https://www.devze.com 2023-03-26 16:17 出处:网络
I am trying to encode Arab开发者_运维百科ic text from a Web service. Currently the values come as question marks (???).

I am trying to encode Arab开发者_运维百科ic text from a Web service. Currently the values come as question marks (???).

I have read many blogs (even stackoverflow answers/links) but nothing seems to worked.

Any idea of how I can resolve this issue?

Thanks


If you use dreamweaver's designer view and paste your Arabic text in design view you will get ascii characters in dreamweaver's code view which will work in any web browser.


First, an important aside: check that the web service you are consuming sends you actual Arabic characters and not actual question marks. Check a network dump if you are not sure, and use wget/curl to perform a simple transaction; check the results.

If the raw data as sent by the WS is question marks, you have an uphill battle - try again and fiddle with the Accept/Accept-Charset headers. If all fail, it may be that the server itself isn't coded properly and there ain't much you can do after that...

Also, you're trying to decode the text, convert it from a byte representation to abstract characters.


This has been the problem Sending UTF-8 data from Android. Your code would work fine except that you will have to encode your String to Base64 . At Server PHP you just decode Base64 String back. It worked for me. I can share if you need the code.

0

精彩评论

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