Unable to define the correct encoding

Hi,

Normally, I know how to deal with encodings, but it seems to be not working in this case.

I have a web app which can send data when asked. This data is usually small and uses the UTF8 encoding (that is, I don’t change the encoding anywhere and use the default).

When the app which receives this data is running on MacOS, iOS or Linux, all is fine; I’m defining the encoding of the data to UTF8.

On Android, it seems that no matter what I try, the encoding is wrong (accented characters appear like ©A, etc.…). I tried defining the encoding to UTF8, SystemDefault, ISOLatin, MacRoman (well, every encoding in the list, by despair), also with ConvertEncoding instead of DefineEncoding, even tried by not setting the encoding at all; nothing changes the string to my expectation. I’m starting to think that the characters are being “decomposed” in the process, between the website and the app, thus defining an encoding won’t recompose them magically. However, it works fine on the other platforms, so it’s not a simple coding mistake.

I’m using a URLConnection object for getting the data. Is this class not handling encodings properly?
What may I try next?

In the meantime, I solved the issue by using EncodeBase64 and DecodeBase64. That was not needed for the other platforms, though, so I’ll use DecodeBase64 everywhere.

FWIW, that’s what the web framework does too.

I think it makes sense.

Since it worked right in macOS, iOS and web, I didn’t check further; at first, I was amazed it worked out of the box, but that’s usually a sign that it’ll fail sooner or later.

Thanks for having confirmed it’s the right thing to do.