accented char - encoding them depends Module? #1204
Replies: 8 comments
-
Posted at 2018-09-27 by Mrbbp i answer myself if i don't use my string.replace it look good (with accents)
with the arrayBuffer, accents must be encoded. But with the TM1640 Module, we drawString directly in the display
is it the cause of the encoding pb? regards |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-09-27 by @allObjects What made you think that you needed a transformation of the characters outside the ASCII set (128..255)? For both displays, the graphics object makes the mapping from character into dot matrix in the display buffer in Espruino memory. The main difference between these modules is only how the involved software components are created and composed to a whole. They all have the Graphics object as the core - which operates on a buffer of pixels in Espruino memory - and a .flip() method that pushes this buffer to the display using the communication component. For MAX7219 you are the plumber, where for TM1640 the plumbing is all done for you. MAX7219 provides you with more flexibility / extensibility (cascading), but setting up the individual components correctly and 'screw' them together is your responsibility. Looking at the module code, you see how everything is baked into one an the same code / method Cascading is done differently: where as with MAX7291 - which is serial in and serial out - data is always sent to the first block of 8x8 and pushed to the next block with every now block sent to the display, with TM1640 the data needs to be chopped up and sent to each individual TM1640 directly. Latter allows you to address each 8x8 block separately without having to change the other blocks. For simplicity though, flip is always updating. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-09-27 by Mrbbp Hello Markus, therefore it looks like more a wish list, than a real problem. regards é. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-09-27 by @gfwilliams I'm not quite sure I understand the problem? When Espruino outputs Graphics should behave the same either way - your issue is finding a font that has glyphs for characters above 128 as the built-in one doesn't to try and save space. What you need is Once that font is set you shouldn't have to do anything to the string - it should 'just work' |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-09-27 by Mrbbp i am the plumber, but the way it work is different with the same instruction (with the same tool). |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-09-27 by Mrbbp i've used the same font on the 2 projects and the same codebase
ide trace "no error with Font4x6", and my accents are good on the display (TM1640) with no encoding, but not on the Max7219. i do not understand why! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-09-27 by Mrbbp well well well i do not understand the issue. I'm confuse. sorry for this post. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-09-27 by @allObjects 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...
Just for the sake of fun I tried a variable name e-accent-egu - for your name's - éric - sake... ;) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2018-09-27 by Mrbbp
Hello,
it should be a newb question... sorry.
i'm working with a 8x8 led matrix
I'm working with string with extented latin chars (éèêàâî,,,).
to draw the string on the display with accents we have to convert accents with char hexa value.
become
i'm a lazy guy and decide to convert the sentence when it's sent to matrix.
i use this code;
it's look as it have to look, but the string is sent as is and i saw on the display "m\xe9m\xe9" and not "mémé" as it should.
What i'have missed?
regards
Beta Was this translation helpful? Give feedback.
All reactions