Some special characters not showing in text or label

I really don't want to become an expert on character coding. If this is not simple, I'll go back to farming. I may never write another program again...but just trying to get something done.

I have an input file (a media asset) that contains this text as an example: "Adam’s transgression' (actually I have multiple files that are much larger...but this suffices as an example). I just want to put the text into a text box.

Note that the apostrophe after Adam is a "special" right single quote--different than the single quote after transgression. Apparently this is a sin because AI can't show the first right single quote (and a bunch of other characters in my text files for that matter).

The text files were written from Excel 2007. Shouldn't AI2 in 2021 be able to read characters written by Excel from 2007? Just seems like that ought to be simple.
image

Try exporting from Excel in UTF-8 format

Thanks. Excel 2007 doesn't offer that.

I don't use Excel, only OpenOffice. I exported a sheet with "quoted" text as csv. AppInventor displayed these characters with no problem. AppInventor supports utf8 encoding and you must provide it with text in this format.

You can put a text file here with the sample of the text you want to display.

Not sure what you mean by "quoted" text. There are a number or characters that I'm dealing with. A better example would be the Pilcrow Sign. If I view my text in Notepad++, with ANSI encoding everything looks great. Pilcrow sign shows correctly. But when I view it in UTF-8 encoding it won't show properly. Shows as xB6, which is apparently the UTF-8 hex value.

If Notepad++ is smart enough to know that it is xB6, and UTF-8 has that character, and I am using UTF-8 encoding why isn't it just showing the character?

I would have thought that UTF-8 (and therefore App Inventor) could handle anything ANSI can handle.

Clearly I'm not understanding something. Shouldn't AI be able to show an exported text file from the world's most popular spreadsheet back in 2007. Seems like we shouldn't even be talking about this.

Put a text file here with the sample of the text you want to display.

Here is a text file.badcharacter.txt (47 Bytes)

Your text uses ANSI encoding. AppInventor does not support ANSI. You can't compare text editors to AppInventor, because text editors are only designed to edit text and have different types of encoding implemented. What you can do to adapt your text to AppInventor:

  • use an ordinary notepad that is in every Windows
  • open your ANSI encoded text file in it
  • save your file again choosing UTF8 encoding type

After these actions, the text looks identical in the notebook and AppInventor reads it without any problems.

txttxt.aia (1.8 KB)

I will investigate the matter of text conversion in android, if I find any other solution I will come back with the information.

1 Like

Thank you!!

I tried coding conversion. I found a way to read an ISO-8859-1 encoded file, it is similar to ANSI encoding but is missing a few characters. I think delivering a UTF8 encoded file to AppInventor is the best way.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.