how to convert Character codes HTML to arabic using c#
-
i have string in Arabic language but it's appear like that
Ï Ì Í Î å Ú Û Ý Þ Ë Õ Ö Ø ã ä Ê Ç Ã á áÃ
Basically I need to convert My source string to Arabic and I do it using following code: i try
string responseXML = Encoding.UTF8.GetString(Encoding.Default.GetBytes(responseXML));
result
Ï Ì Í Î å Ú Û Ý Þ Ë Õ Ö Ø ã ä Ê Ç Ã á áÃ
but the right result is
string"د ج ح خ ه ع غ ف ق ث ص ض ط م ن ت ا أ ل لأ ب ي س ش ظ ز و ة ى لا ر ؤ ء ئ ذ"
What I'm doing wrong here?
-
i have string in Arabic language but it's appear like that
Ï Ì Í Î å Ú Û Ý Þ Ë Õ Ö Ø ã ä Ê Ç Ã á áÃ
Basically I need to convert My source string to Arabic and I do it using following code: i try
string responseXML = Encoding.UTF8.GetString(Encoding.Default.GetBytes(responseXML));
result
Ï Ì Í Î å Ú Û Ý Þ Ë Õ Ö Ø ã ä Ê Ç Ã á áÃ
but the right result is
string"د ج ح خ ه ع غ ف ق ث ص ض ط م ن ت ا أ ل لأ ب ي س ش ظ ز و ة ى لا ر ؤ ء ئ ذ"
What I'm doing wrong here?
You're probably using the wrong encoding. What encoding does the HTTP response declare? Content-Encoding - HTTP | MDN[^] What encoding does the XML document declare (if any)? XML Declaration - Wikipedia[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
You're probably using the wrong encoding. What encoding does the HTTP response declare? Content-Encoding - HTTP | MDN[^] What encoding does the XML document declare (if any)? XML Declaration - Wikipedia[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
i get data from QuickBooks like this
*أاإ ب ت ث ج ح خ د ذ ر ز س ش ص ض ط ظ ع غ
it retrain the encoding of the xml response declare is ISO-8859-1 (ISO Latin 1) like this
Ï Ì Í Î å Ú Û Ý Þ Ë Õ Ö Ø ã ä Ê Ç Ã á áÃ
i didn't find away to convert it to Arabic direct so i convert it to html encode like this
Ï Ì Í Î å Ú Û Ý Þ Ë Õ Ö Ø ã ä Ê Ç Ã á áÃ
now i want to convert html encode to Arabic i don't know how can help me thanks
-
i get data from QuickBooks like this
*أاإ ب ت ث ج ح خ د ذ ر ز س ش ص ض ط ظ ع غ
it retrain the encoding of the xml response declare is ISO-8859-1 (ISO Latin 1) like this
Ï Ì Í Î å Ú Û Ý Þ Ë Õ Ö Ø ã ä Ê Ç Ã á áÃ
i didn't find away to convert it to Arabic direct so i convert it to html encode like this
Ï Ì Í Î å Ú Û Ý Þ Ë Õ Ö Ø ã ä Ê Ç Ã á áÃ
now i want to convert html encode to Arabic i don't know how can help me thanks
If the data is encoded using ISO-8859-1, then you can't use UTF8 to decode it. You need to specify the correct encoding:
Encoding iso = Encoding.GetEncoding("ISO-8859-1");
The question remains, since you already have a string, why are you decoding it to bytes simply to encode it back to a string?
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
i have string in Arabic language but it's appear like that
Ï Ì Í Î å Ú Û Ý Þ Ë Õ Ö Ø ã ä Ê Ç Ã á áÃ
Basically I need to convert My source string to Arabic and I do it using following code: i try
string responseXML = Encoding.UTF8.GetString(Encoding.Default.GetBytes(responseXML));
result
Ï Ì Í Î å Ú Û Ý Þ Ë Õ Ö Ø ã ä Ê Ç Ã á áÃ
but the right result is
string"د ج ح خ ه ع غ ف ق ث ص ض ط م ن ت ا أ ل لأ ب ي س ش ظ ز و ة ى لا ر ؤ ء ئ ذ"
What I'm doing wrong here?
Just print / display responseXML before tinkering with it. Your "result" is single byte characters where the "right result" (and input apparently) happens to be "double-byte" characters.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it. ― Confucian Analects: Rules of Confucius about his food