So I need to decode a from ASCII to text:
ex: ف َ إ ِ ن ّ َ   ٱ ل ْ ج& #1614 ن ّ َ ة َ
All separated by ";"
would be: فَإِنَّ ٱلْجَنَّة
I looked into dart:convert package and it's Ascii decoder it doesn't seems to be an answer. any thoughts
CodePudding user response:
You need understand that ف is html definition of 1601 decimal character code on ASCII table.
on Dart to get char from code you need just call
String.fromCharCode(1601)
-> ف
Here is some example from your case
String str = "ف َ إ ِ ن ّ َ   ٱ ل ْ ج َ ن ّ َ ة َ";
var maped = str.split(' ').map((charCode) {
return String.fromCharCode(
int.parse(charCode.replaceAll('&#', ''))
);
}).join('');
print(maped);
OUTPUT:
فَإِنَّ ٱلْجَنَّةَ