ios - Language Localisation -


i developing application supports 4 different languages. 1 of language arabic. used opensans font in whole application

i getting below json response,

"card_description" = "\u00d9\u0160\u00d9\u2026\u00d9\u0192\u00d9\u2020\u00d9\u0192 \u00d8\u00b1\u00d9\u0192\u00d9\u02c6\u00d8\u00a8 \u00d8\u00a7\u00d9\u201e\u00d8\u00af\u00d8\u00b1\u00d8\u00a7\u00d8\u00ac\u00d8\u00a9 \u00d9\u02c6\u00d8\u00a7\u00d9\u201e\u00d8\u00aa\u00d9\u2020\u00d9\u201a\u00d9\u201e \u00d8\u00a8\u00d9\u2021\u00d8\u00a7 \u00d8\u00b9\u00d8\u00a8\u00d8\u00b1 \u00d8\u00a7\u00d9\u201e\u00d9\u0192\u00d8\u00ab\u00d9\u0160\u00d8\u00b1 \u00d9\u2026\u00d9\u2020 \n\u00d8\u00a7\u00d9\u201e\u00d9\u2026\u00d8\u00af\u00d9\u2020 \u00d9\u02c6\u00d8\u00a7\u00d9\u201e\u00d8\u00a8\u00d9\u201e\u00d8\u00af\u00d8\u00a7\u00d8\u00aa \u00d9\u0081\u00d9\u0160 \u00d8\u00a7\u00d9\u201e\u00d8\u00af\u00d8\u00a7\u00d9\u2020\u00d9\u2026\u00d8\u00a7\u00d8\u00b1\u00d9\u0192"; 

by converting in utf8string, getting below result after running application in simulator.

enter image description here

used below code display text in label,

[cell.btndescription settitle:[nsstring stringwithutf8string:[[[arrcards objectatindex:indexpath.row] valueforkey:wcard_desc] cstringusingencoding:nsutf8stringencoding]] forstate:uicontrolstatenormal]; 

i not getting proper arabic language result.

can me?

thanks in advance.

you don't need following code decrypting arabic content.

[cell.btndescription settitle:[nsstring stringwithutf8string:[[[arrcards objectatindex:indexpath.row] valueforkey:wcard_desc] cstringusingencoding:nsutf8stringencoding]] forstate:uicontrolstatenormal]; 

the whole thing coming json , decode/encode you, have faced same problem arabic app, , json developer did add header function i.e

  1. header('content-type: application/json;charset=utf-8');

and decode value function below:

  1. html_entity_decode

follow image below, may you.

enter image description here

thanks


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -