scheme / scsh

A Unix shell embedded in scheme
Other
386 stars 36 forks source link

Unicode seems to be broken #47

Open ceving opened 1 year ago

ceving commented 1 year ago

See the following example:

$ export LC_ALL=C
$ ./scsh -s unicode.scm 
Hello ???Alice???
$ export LC_ALL=de_DE.UTF-8
$ ./scsh -s unicode.scm 
Hello âAliceâ
$ cat unicode.scm 
(display "Hello ‘Alice‘\n")
$ petite --script unicode.scm 
Hello ‘Alice‘
bitstreamout commented 1 year ago

On 2023/01/13 03:40:19 -0800, ceving wrote:

See the following example:

$ export LC_ALL=C
$ ./scsh -s unicode.scm 
Hello ???Alice???
$ export LC_ALL=de_DE.UTF-8
$ ./scsh -s unicode.scm 
Hello âAliceâ
$ cat unicode.scm 
(display "Hello ‘Alice‘\n")
$ petite --script unicode.scm 
Hello ‘Alice‘

Can not follow that

/suse/werner> locale LANG=C.UTF-8 LC_CTYPE=de_DE.UTF-8 LC_NUMERIC="C.UTF-8" LC_TIME="C.UTF-8" LC_COLLATE="C.UTF-8" LC_MONETARY="C.UTF-8" LC_MESSAGES="C.UTF-8" LC_PAPER=de_DE.UTF-8 LC_NAME="C.UTF-8" LC_ADDRESS="C.UTF-8" LC_TELEPHONE="C.UTF-8" LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION="C.UTF-8" LC_ALL= /suse/werner> scsh -c '(display "Hello ‘Alice‘\n")' Hello ‘Alice‘

Werner

-- "Having a smoking section in a restaurant is like having a peeing section in a swimming pool." -- Edward Burr

ceving commented 1 year ago

The option -c works for me, too:

$ scsh -c '(display "Hello ‘Alice‘\n")'
Hello ‘Alice‘

But the option -s does not work:

$ scsh -s <(echo '(display "Hello ‘Alice‘\n")')
Hello âAliceâ

Maybe any kind of Perlism (source files are treated as Latin)?