charset_converter
charset_converter copied to clipboard
Error on encoding x-IBM1098 and x-IBM1097
When I want to try encode Persian character it show same digit for all characters Uint8List encoded = await CharsetConverter.encode("x-IBM1098", "سلام"); It shows: 127, 127, 127, 127, 127 It's so weird a digit for different character and when I try to decode this numbers It shows some square icon.
Hmm, I could not find x-IBM1098. What platform do you use?
I check if ISO-8859-6 would work and it seems fine.
I saw it on availableCharacterSets and It's the only characterset that works fine with Persian language and It's for Iran System Encoding. Altough the decode function works fine with that. I used it on Android.
Alright, I'll look into this, but I need to get some Androids first.
If you have any clues why that might happen I'd be happy to learn that. Thanks!
I am not sure if this text can be expressed in this encoding and it seems like this encoding returns 127 when it meets a character it can not understand. I was successful with IBM-1256/CP-1256/Windows-1256 for your example text I got bytes 211, 225, 199, 227 where ISO-8859-6 returned 211, 228, 199, 229.
@sgsm74 have you perhaps already solved this issue?
Yep, by creating my own class for converting characters. I used it for an inbuilt-printer pos device (citaq) and It was okay