Transfer a string from one device to another via QR scanner/generator [UTF-8]

I’m trying to do this extremely (or so I thought) simple thing:

  1. On device A: Type in a string in a text field

  2. On device A: Generate a QR code based on this string with the great QRGenerator library from torbenratzlaff.

  3. On device B: Scan this QR code with the QR Scanner plugin

  4. On device B: Display this text on a text field 

This works well for standard characters, but as soon as some special characters are involved it goes ad undas. Surely there is some UTF-8 stuff going on, but I just cannot crack it.

In the attached small example app, there is one text field and as text is entered a qr code is generated. The string is json encoded (because originally there are several strings in a list) and the JSON encoded list look like this in the log from “transmitting app” (when entering the word “døv”).

{“s”:“døv”}

This is also how it look if I scan this with a third party app like QR Code Reader.

But if I scan the exact same image with the QR Scanner plugin (with another device) the read JSON encoded string shows like this in the log (using adb logcat):

{“s”:“d∩╛â∩╜╕v”}

And showing the JSON encoded string directly in the app shows like this:

That the log showing in a Windows cmd window isn’t correct isn’t all that surprising, but how the string showing in the app itself becomes that garbled is a problem. 

I’ve tried to use some utf8_decode code on the string, but that doesn’t seem to work either…

Is there any foolproof way of doing this string transfer safely?

Maybe this will be helpful. 

Thank you. However, I hope that my problems are far simpler and that it’s just me who does not know how this all works.

Or can these problems also arise between the Windows Corona simulator and an Android 7 device?

Maybe this will be helpful. 

Thank you. However, I hope that my problems are far simpler and that it’s just me who does not know how this all works.

Or can these problems also arise between the Windows Corona simulator and an Android 7 device?