I’m playing around with an iOS app that needs to show accented characters (e.g. é).
The app reads the text in from a text file. That works. However, all the accented characters (actually anything not ASCII) comes in as the “unknown character character” at which point we get a runtime exception.
A couple of things:
I put a try-catch around the line that was throwing the exception, and it wasn’t caught.
What am I doing wrong? The amount of text in the file is small (about 10 lines) so I do a readAll on the TextInputStream. I’ve tried setting the encoding. No difference.
At this point I don’t know if it’s me or Xojo (I’m voting me).
I have solved (worked around) the problem and possibly found something.
When the accented characters were not working, the file was being copied using a copy script as part of the build. What I did (after an experiment) is place the text in a constant. After doing that, things worked as expected.
That’s because Xojo stores all of its constants as UTF-8. It was about to detect the encoding of the incoming text and properly interpret it. Whatever text editor you used to copy it was also able to figure out what encoding the original file was saved in.