moonbit-docs icon indicating copy to clipboard operation
moonbit-docs copied to clipboard

Arabic letters not rendering in string print

Open abusaidm opened this issue 2 years ago • 5 comments

Amazing work team,

I tried adding arabic letters in the string and it printed garbage. (screenshot attached)

image

Code block in case you want to reproduce or test for

func init {
  // oop style method call
  "hello moonbit\n".print()
  "مرحبا moonbit".print()
}

output should look like the input in terms of drawing :)

abusaidm avatar Aug 19 '23 13:08 abusaidm

Thanks for your feedback, Moonbit currently supports Latin-1, CJK characters, Basic emoji. We will support more character sets in the future.

liweijian avatar Aug 20 '23 00:08 liweijian

Thanks for your feedback, Moonbit currently supports Latin-1, CJK characters, Basic emoji. We will support more character sets in the future.

This is about string printing, not identifiers. We may need to modify the runtime. cc @lijunchen

pe200012 avatar Aug 20 '23 02:08 pe200012

It seems that all Unicode character (non-ASCII) print error.

func init {
  "test 666 测试".print();
}

This can reproduce here https://try.moonbitlang.com/

secext2022 avatar Aug 30 '23 11:08 secext2022

Screenshot 2023-09-28 at 17 35 24

There are still some issues but basic printing should work now

bobzhang avatar Sep 28 '23 09:09 bobzhang

Thank you, it works !

The current implementation decode utf-8 bytes (of whole line) at LF (\n) char. So you should print \n (or use println()) for it to work.

secext2022 avatar Sep 28 '23 22:09 secext2022