Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISO-8859-7 specific characters are causing encoding to fail #7

Open
niktses opened this issue Oct 22, 2020 · 3 comments
Open

ISO-8859-7 specific characters are causing encoding to fail #7

niktses opened this issue Oct 22, 2020 · 3 comments
Assignees
Labels
bug Something isn't working iOS

Comments

@niktses
Copy link

niktses commented Oct 22, 2020

String encoding = "ISO-8859-7";
var encoded = await CharsetConverter.encode(encoding, line.text);

No matter the encoding used i get this error on ios.
Android works fine.

PlatformException(encoding_failed, Encoding failed, reason unknown, null, null)

@pr0gramista pr0gramista self-assigned this Oct 22, 2020
@pr0gramista
Copy link
Owner

Hmm from my first tests it seems to be working 🤔

Could you provide an example line of text that you are trying to encode?

@niktses
Copy link
Author

niktses commented Oct 22, 2020

String greekText = "αβγδεζηθικλμνξοπρστυφχψωΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ€";
String encoding = "ISO-8859-7";
var encoded = await CharsetConverter.encode(greekText);

@pr0gramista
Copy link
Owner

I found that αβγδεζηθικλμνξοπρστυφχψωΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ works. The problem is in the Euro sign, which wasn't present on ISO-8859-7 originally (was added in 2003) and the formal version is from 1987. Some sites doesn't include the Euro sign.

x-mac-greek does encode. but Euro sign is 156, where it should be 164. Damm you Apple.

I think the only way is to actually handle those by yourself - in the end thats only 3 characters to map. I may add some code later to handle those special cases. Thanks for reaching out!

@pr0gramista pr0gramista changed the title IOS not working ISO-8859-7 specific characters are causing encoding to fail Oct 22, 2020
@pr0gramista pr0gramista added bug Something isn't working iOS labels Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working iOS
Projects
None yet
Development

No branches or pull requests

2 participants