我正在尝试让一个 telnet 客户端作为一个辅助项目工作,我将此要点视为一个基本示例。但是,当我在 ghci 中编译并运行它时,您会看到编码出现乱码。以下是人物参考:
���� ��#��'
我的猜测是,这是因为当 telnet 使用7-bit ASCII / special telnet bit for codes时,Conduit 对于所有传输默认为 UTF-8 。此外,stdout / 终端是否能够直接解释 UTF-8,而无需进行任何转换?
先感谢您!
我正在尝试让一个 telnet 客户端作为一个辅助项目工作,我将此要点视为一个基本示例。但是,当我在 ghci 中编译并运行它时,您会看到编码出现乱码。以下是人物参考:
���� ��#��'
我的猜测是,这是因为当 telnet 使用7-bit ASCII / special telnet bit for codes时,Conduit 对于所有传输默认为 UTF-8 。此外,stdout / 终端是否能够直接解释 UTF-8,而无需进行任何转换?
先感谢您!
conduit doesn't make any assumptions about character encoding, the functions you're using from that gist all operate purely at the binary level. It seems like the telnet server you're connecting to is (unsurprisingly) sending out non-ASCII data as special commands, and you're sending them directly to the terminal, which does not have any way to display them.