Maintenant, je compris, Eric. --- What does not enter my mind though is why should it be different as @Gordon points out: if the font supports 8 bit, which - I hope - both of your projects use the same font. What @Gordon says is that a string can be passed on in two ways: with 8 bit character set as "mémé", but when only seven bits are considered, it has to be "m\xe9m\xe9". It is almost like a shift-in and shift-out for each single character that is above 127 ASCII value (MS BIT set). I did not know that Espruino (only? or JavaScript in general? or strings in general - latter most likely a standard how to deal w/ 8 bit chars in a 7 bit world) has this feature... but it is nice to know. Somewhere along the line - when the string is transported / chopped up into characters / mapped to the font - this matters and weird things happen... I expect it the cooperation of Graphics and Font object - similar to the following out put created in console. It looks to me that for strings with MSBit set, an encoding happens on transport to and/or from console entry to Espruino and back... (console) echo behaves 7-bit-ish and different from 8-bit-ish console.log().
Connected to /dev/cu.usbmodem14111
>var ps = "mémé";
="m\xE9m\xE9"
>var cs="m\xE9m\xE9"
="m\xE9m\xE9"
>console.log(ps)
mémé
=undefined
>console.log(cs);
mémé
=undefined
>var c = "é"
="\xE9"
>cs.length
=4
>ps.length
=4
>é
Uncaught SyntaxError: Got ?[233] expected EOF
at line 1 col 1
?[233]
^
>var é = 5
Uncaught SyntaxError: Got ?[233] expected EOF
at line 1 col 5
var ?[233] = 5
^
>
Just for the sake of fun I tried a variable name e-accent-egu - for your name's - éric - sake... ;)
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Maintenant, je compris, Eric. --- What does not enter my mind though is why should it be different as @Gordon points out: if the font supports 8 bit, which - I hope - both of your projects use the same font. What @Gordon says is that a string can be passed on in two ways: with 8 bit character set as "mémé", but when only seven bits are considered, it has to be "m\xe9m\xe9". It is almost like a shift-in and shift-out for each single character that is above 127 ASCII value (MS BIT set). I did not know that Espruino (only? or JavaScript in general? or strings in general - latter most likely a standard how to deal w/ 8 bit chars in a 7 bit world) has this feature... but it is nice to know. Somewhere along the line - when the string is transported / chopped up into characters / mapped to the font - this matters and weird things happen... I expect it the cooperation of Graphics and Font object - similar to the following out put created in console. It looks to me that for strings with MSBit set, an encoding happens on transport to and/or from console entry to Espruino and back...
(console) echo
behaves 7-bit-ish and different from 8-bit-ishconsole.log()
.Just for the sake of fun I tried a variable name e-accent-egu - for your name's - éric - sake... ;)