Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unicode support #21

Closed
pavlos256 opened this issue Sep 24, 2021 · 2 comments · Fixed by #22
Closed

Unicode support #21

pavlos256 opened this issue Sep 24, 2021 · 2 comments · Fixed by #22
Assignees
Labels
bug Something isn't working

Comments

@pavlos256
Copy link
Contributor

Atto has problems with some Unicode characters (like emoji).

Example program:

10 PRINT "Καλημέρα 😄"

test.atto.txt

2021-09-24_16-37

The problem is that when accessing chars like text[9], the emoji is returned in two parts (positions 9 & 10). A workaround is to do:

var chars = Array.from(text);

Then chars[9] will return "😄".

Applying this change to term.js:print() and canvas.js:drawText() seems to be enough to make the above program run correctly. The program listing still has problems though, because of the hid.js:render function.

@James-Livesey James-Livesey added the bug Something isn't working label Sep 24, 2021
@James-Livesey
Copy link
Member

Today I learned about the Array.from function for Unicode conversion! Thanks for letting me know about this bug, though. I do think that emoji would be a welcome addition to atto! I'll look into this and let you know when it's all fixed.

@James-Livesey
Copy link
Member

All issues with rendering emoji should be solved now! Hopefully this will be a great addition for younger users of atto who want to add emojis to their programs. I remember users of educational programming languages such as Hopscotch heavily relying on emoji to convey pictorial meaning, so there's no doubt that emojis will be used a lot in atto!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants