Conversation
b659dfc to
019a6b6
Compare
|
I looked into the cause of the test error, and it seems that it may not be a problem with the Python interpreter selection. Traceback (most recent call last):
File "<string>", line 1, in <module>
File "examples/helloworld.er", line -1, in <module>
UnicodeEncodeError: 'cp932' codec can't encode character '\u03ac' in position 3: illegal multibyte sequenceI don't remember seeing this error when I wrote this test, but this output may have been obtained as a result of several improvements to make the test results readable.
In fact, the test passed when I deleted everything except alphabets and hiragana. |
8d570ee to
2febb71
Compare
examples/helloworld.er
Outdated
| @@ -1,3 +1,6 @@ | |||
| sys = pyimport "sys" | |||
| sys.stdout.reconfigure!(encoding:="utf-8") | |||
There was a problem hiding this comment.
It is inconvenient that multilingual support is only available if the user sets it up using sys.stdout.reconfigure!, so I think it would be better to include a process to embed this code when generating the code.
For example, Erg embeds a code in the bytecode that passes its own standard API path and loads it. Using this as a reference, it is possible to call sys.stdout.reconfigure first.
erg/crates/erg_compiler/codegen.rs
Lines 3929 to 3953 in b2fb80c
4d9c25c to
017b13f
Compare
2febb71 to
c2c2931
Compare
Co-authored-by: Shunsuke Shibayama <sbym1346@gmail.com>
7037f03 to
1bfd382
Compare
Changes proposed in this PR:
@mtshiba