wren-lang / wren-cli

A command line tool for the Wren programming language
MIT License
129 stars 30 forks source link

Emojis not supported in REPL #25

Open clsource opened 4 years ago

clsource commented 4 years ago

System.print("📟")

will throw Unhandled key-code [dec]: 240

using MacOS Catalina Wren 0.3.0

joshgoebel commented 3 years ago

This is because all input is handled one byte at a time. Even if your remove the error you don't get an Emoji you just get two high ASCII characters... I wonder if the input loop shouldn't work with codePoints directly? #67 Otherwise it would have to include it's own UTF-8 handling logic...

joshgoebel commented 3 years ago

@clsource Can you test? :-)

joshgoebel commented 3 years ago

@ruby0x1 Can you confirm this is desirable (UTF-8 input) before I spend much more time on this... I presume it should be since we support UTF-8 natively... so it makes sense I think that this would "just work"... of course it'd only make sense inside strings, etc...

clsource commented 3 years ago

Ok will do some testing :) is this the PR right? https://github.com/wren-lang/wren-cli/pull/71

joshgoebel commented 3 years ago

Yes. :)

joshgoebel commented 1 year ago

May I ask which PR completed this work? I see 71 is still open.

clsource commented 1 year ago

Sorry my bad, I was just closing many issues to keep my pending list tidy. Linking to the issue https://github.com/wren-lang/wren-cli/pull/71