为什么在 ssh 时不能正确呈现引号和其他非字母数字字符?

use*_*637 3 ubuntu ssh putty

以下是从运行 ubuntu 和 gnome gui 的我的计算机访问时 mysql 手册页中的一行

"Command-Line Options that Affect Option-File Handling".
Run Code Online (Sandbox Code Playgroud)

这一行被渲染成这样:

âCommand-Line Options that Affect Option-File Handlingâ
Run Code Online (Sandbox Code Playgroud)

当我使用腻子从我的 Windows 计算机 ssh 进入 ubuntu 计算机时。

为什么引号被呈现为â?有什么办法可以让我的 ssh 会话正确呈现手册页?

编辑

Putty 已经将“终端类型字符串”设置为 xterm,这是我的 .profile:

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
        . "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi
Run Code Online (Sandbox Code Playgroud)

我不认为终端类型被覆盖

cyb*_*x86 6

在 PuTTY 中更改您的字符集:

窗口 > 翻译 > 远程字符集

  • 默认字符集是 ISO-8859-1:1998 (Latin-1, West Europe)
  • 将其更改UTF-8为 unicode 支持 - 这应该正确呈现您的字符。

(我在亚马逊的 Linux 上遇到了同样的问题——motd 消息有 unicode 字符,所以它是一个不断提醒并促使我寻找解决方案的问题)。


Dav*_*rtz 5

ConnectionConnection->Data(取决于您的 PuTTY 版本)下,您将看到一个条目“终端类型字符串”。尝试将其设置为xterm.

请注意,如果您正在连接的机器上的当前用户配置文件覆盖了您的终端类型,则您必须在那里更改它。在您的主目录中查找以 开头.profile在其名称中包含的文件。(你可以ls -a ~/.*profile*用来检查。)

注意:编辑配置文件时要格外小心。我建议保持一个会话登录以恢复任何更改,并在注销前确认您可以登录一个新会话。