MobMuPlat icon indicating copy to clipboard operation
MobMuPlat copied to clipboard

Special Character on Android

Open jennifer-debug opened this issue 4 years ago • 4 comments

Hi, I would like to insert some word with special characters from Danish : "å ø æ ".... When I tried to insert them they turn out like chinesse character. I guess I need to change the font or the Ascii table. However, for android I have only the choice with "roboto" font. Do you have any other suggestion? Best Jennifer.

jennifer-debug avatar Nov 25 '20 08:11 jennifer-debug

Is it a character that it in an interface label (i.e. set in the interface editor), or is it something generated in Pure Data and setting an interface label dynamically?

monkeyswarm avatar Nov 25 '20 16:11 monkeyswarm

This will be a dynamical label. This is very weird. Let me try to explain... I have this text file with Danish sentences (see attachment). I would like to replace the content of a label by each line of this text. First, I am defining a text (call here text Dag1.txt into text_test).

Then each I am going to press on my button, I will update a pointer, that will read the next line of the text and send to /myLabel. Everything works fine, except that some of the special danish letters æ ø å are sometimes shown correctly (like in hjemløs), and sometimes is transformed into some weird Chinese character like "mørk". This is weird, I have checked with an Hex editor, and those characters are coded in a similar way. It seems that the surrounding will trigger or not this strange behaviour. I am clueless. Thanks for your help

control.zip

jennifer-debug avatar Nov 25 '20 20:11 jennifer-debug

Hi

Question: how did you make the .mmp file (which editor, and did you then tweak the JSON characters by hand?)? And are you using it on iOS or Android?

Briefly, I assumed that users would only use ASCII characters, since that is all that Pure Data supports. I should not have made that assumption.

There is a lot going on here. Basically, every piece of software involved (PureData, the MacOS editor, the Java cross-platform editor, the iOS app, and the Android app) each handles non-ASCII character encodings differently.

PureData is one-byte-ber-character, which they say is ASCII-only, but it turns out it will properly handle the whole byte and display in Western ISO-Latin character set (which supports Danish characters, so they show up in PureData [text] objects and messages)

MacOS editor is ASCII-only when loading and saving projects. It will not save the MMP file if there are any non-ascii characters. It will attempt to load, but its internal encoding seems to get it wrong (shows a different Danish-looking character).

Java Editor will write based on the character contents, either ASCII or UTF-8. But when loading a label text, will add <?> character for non-ASCII

iOS app will fail to load an .mmp with non-ASCII characters

Android app seems to load the mmp, but display incorrectly, truncating strings when it received a non-ascii character.

I don't think there is anything you can do at this moment. I need to reconsider how to support another character encoding (and whether that should be UTF-8 vs something else). I need to see if this will break existing projects or not. This is a significant change.

monkeyswarm avatar Nov 25 '20 22:11 monkeyswarm

Ok, thank. That makes sense. I will find another way. Thank you anyway for this great app, and your dedication to making it work. Best

jennifer-debug avatar Nov 30 '20 10:11 jennifer-debug