Aar*_*ron 1 linux shell bash terminal
这几年出现了一些Linux系统在运行各种命令时会输出奇怪的字符。这是我sensors在其中一台机器上的命令输出的示例:
acpitz-virtual-0
Adapter: Virtual device
temp1: +45.5°C (crit = +126.0°C)
coretemp-isa-0000
Adapter: ISA adapter
Core 0: +44.0°C (high = +100.0°C, crit = +100.0°C)
Core 1: +45.0°C (high = +100.0°C, crit = +100.0°C)
nouveau-pci-0100
Adapter: PCI adapter
temp1: -62.0°C (high = +95.0°C, crit = +99.0°C)
Run Code Online (Sandbox Code Playgroud)
注意Â整个地方的角色。为什么在某些环境中会发生这种情况,而在其他环境中不会发生这种情况?我能做些什么来纠正这个问题?
要么使用能理解 UTF-8 的终端程序,要么告诉你的 shell 不要通过$LANG.
>>> print u'°'.encode('utf-8').decode('latin-1')
°
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6437 次 |
| 最近记录: |