Closed fsgmhoward closed 2 years ago
I'll check it in centos8
try this: export LC_ALL=en_US.UTF-8 export LANG=en_US.UTF-8 source /etc/profile
No. It is not working.
[root@storage-1 miner]# export LC_ALL=en_US.UTF-8
[root@storage-1 miner]# export LANG=en_US.UTF-8
[root@storage-1 miner]# source /etc/profile
[root@storage-1 miner]# ./cmd -h
Traceback (most recent call last):
File "cmd.py", line 223, in <module>
File "asyncio/base_events.py", line 616, in run_until_complete
File "cmd.py", line 218, in main
File "cmd.py", line 29, in help_menu
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-4: ordinal not in range(128)
[201104] Failed to execute script cmd
I guess a quick way to make this working is to provide a version with only ASCII output (i.e. a version with basic English output), preferably using a older GLIBC (centos's built-in glibc is 2.28). I compiled the GLIBC from source code and use elfpatch to change the rpath to the newer GLIBC. Although not very likely, there is a possibility that I messed up this.
First is the version of GLIBC used. The libpython3.8 is compiled using a newer version than the one in CentOS 8.
This is still resolvable. The shared library can be loaded after I compiled a new GLIBC 2.29. However, now it comes the second error:
Since this binary is packaged using pyinstaller and I assume it is in frozen mode, so I am not able to use any environment variable to make it work. I tried
LANG
,LC_ALL
,PYTHONIOENCODING
and none of them works. I am 100% sure that my console is able to output Chinese characters and is set in UTF-8 mode.Chinese stdout test: