I have some problems with displaying some Arabic text in my iPhone application. When I am displaying it on a UILabel
, it shows like ?????? ????? ??????
The string comes from server as XML, I parse it and display on a UILabel. I dont know this is due to a problem in iPhone or from Server side.
I want to know how can I determine the string coming from server is having correct encoding and is a valid Arabic characters.
Is it suffice to print value each character and check it lies between Arabic Unicode characters. (Like ASCII value of character A is 65 and that of Z is 90. So a value 70 must be a ASCII character).
In server the string is encoded with UTF8 encoding. And server program written in c#. What is the write encoding method to transfer Arabic text from server to iPhone?
Do I need to use other fonts to display Arabic characters correctly.
Is there any XML file with Arabic content in Internet, from where I can parse and display arabic text correctly?
Thanks in advance..
EDIT:
When I NSLogged XML data I got same ???? ???? ???
characters.
EDIT
See a XML styled data that I got in console.
<CB_SEC_COMP>
<SC_COMP_ID>9999</SC_COMP_ID>
<SCA_LONG_NAME>???? ????? ?????????? ????? ?????????</SCA_LONG_NAME>
<SCE_LONG_NAME>CHINA SECURITY & SURVEILLANCE TECHNOLOGY, INC.</SCE_LONG_NAME>
<SCA_SHORT_NAME>???? ????? ?????????</SCA_SHORT_NAME>
<SCE_SHORT_NAME>CHINA SECURITY & SUR</SCE_SHORT_NAME>
<SC_MRK_CODE>9</SC_MRK_CODE>
<SC_SEC_CODE>86</SC_SEC_CODE>
<SC_STATUS>Y</SC_STATUS>
<TICKER_ID>CSR</TICKER_ID>
<SC_MRK_TYPE_CODE>0001</SC_MRK_TYPE_CODE>
<SC_EXCHANGE>DFM</SC_EXCHANGE>
<CUR_CODE>AED</CUR_CODE>
</CB_SEC_COMP>
No comments:
Post a Comment