Issue with unicode string processing #2035
-
I'm using a computer to control heres are my scripts.
display.lua
I don't need to display these characters on the computercraft monitor, just send them correctly to This is my first time posting a github discussion, so please correct me if I've done something wrong! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
In CC:T, string only stores as byte array inside the [cobalt] lua machine. At anytime it goes to the peripherals, the string will be represented as char sequences, which will not be encoded as utf8 or any other char types in the operation. |
Beta Was this translation helpful? Give feedback.
-
You can see related discussion about it in #860 but at current time there really is no feasible way for CC to display unicode characters internally. Alternative solution i have seen players use is to write custom font texture font for CC:T basically replacing upper rows (from A_ onward) If you had a peripheral that was able to understand utf8 endcoded string then CC:T has backported lua 5.3 utf8 library https://www.lua.org/manual/5.3/manual.html#6.5 so one could easily create encoded string but i don't believe that any current peripheral mods that display text offer that option. |
Beta Was this translation helpful? Give feedback.
You can see related discussion about it in #860 but at current time there really is no feasible way for CC to display unicode characters internally.
Alternative solution i have seen players use is to write custom font texture font for CC:T basically replacing upper rows (from A_ onward)
With their own custom characters, and then writing programs that display those characters, knowing they are replaced in texture file with what user wants. This is sadly not universal solution as it requires all players to use modified texture pack to see modified characters and requires writing a program in quite annoying way to display them.
If you had a peripheral that was able to understand utf8 endc…