wren-cli icon indicating copy to clipboard operation
wren-cli copied to clipboard

Emojis not supported in REPL

Open clsource opened this issue 5 years ago • 7 comments

System.print("📟")

will throw Unhandled key-code [dec]: 240

using MacOS Catalina Wren 0.3.0

clsource avatar Mar 29 '20 01:03 clsource

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 avatar Apr 25 '21 23:04 joshgoebel

@clsource Can you test? :-)

joshgoebel avatar Apr 26 '21 02:04 joshgoebel

@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...

joshgoebel avatar Apr 26 '21 04:04 joshgoebel

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

clsource avatar Apr 26 '21 04:04 clsource

Yes. :)

joshgoebel avatar Apr 26 '21 04:04 joshgoebel

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

joshgoebel avatar Aug 28 '23 02:08 joshgoebel

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

clsource avatar Aug 30 '23 00:08 clsource