简体   繁体   English

无法显示unicode

[英]Can't display unicode

I have a feeling that this has already been answered somewhere: if so I apologise. 我觉得这已经在某处得到了回答:如果是的话,我表示歉意。

I am trying to use an executable that writes Unicode characters to standard output. 我正在尝试使用将Unicode字符写入标准输出的可执行文件。 All I get is this error message (hPutChar from Haskell): 我得到的只是以下错误消息(来自Haskell的hPutChar):

<stderr>: hPutChar: invalid argument (invalid character)

Just to be clear: the executable is not mine, I cannot change what it outputs. 请明确:可执行文件不是我的,我无法更改其输出。

Is there some way to get bash to display these characters? 有什么办法让bash显示这些字符吗? My bash version is 4.3.30 on Debian Jessie. 我的bash版本是Debian Jessie上的4.3.30。

Thanks very much. 非常感谢。

Your user environment is not set up correctly to handle Unicode. 您的用户环境未正确设置为处理Unicode。 Your locale should be set to <language>_<territory>.utf-8 or some spelling variation thereof (some systems use UTF8 or utf8). 您的语言环境应设置为<language>_<territory>.utf-8或其某些拼写形式(某些系统使用UTF8或utf8)。 Type locale -a to see a list of supported locales. 键入locale -a以查看受支持的语言环境的列表。 Type 类型

 export LANG=<your preferred locale name>

and run your progran again. 并再次运行您的程序。 The program should stop complaining. 该程序应停止抱怨。 If you don't see correct characters, and you are running X11, type xterm& (or whatever terminal emulator you prefer) in the same session, and try again. 如果看不到正确的字符,并且您正在运行X11,请在同一会话中键入xterm& (或您喜欢的任何终端仿真器),然后重试。

If there are no suitable locales, you may need to generate some. 如果没有合适的语言环境,则可能需要生成一些语言环境。 This seem to explain how to do that on Debian. 似乎可以解释如何在Debian上执行该操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM