Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

fluffos #65

Open
dfbb opened this issue Jan 13, 2021 · 8 comments
Open

fluffos #65

dfbb opened this issue Jan 13, 2021 · 8 comments

Comments

@dfbb
Copy link

dfbb commented Jan 13, 2021

https://github.com/fluffos/fluffos using libtelnet,

when using OSX telnet client to connect the server,
it will strip UTF-8 character High byte to ansi char.

Using Linux/Windows telnet client, everything is fine.

@thefallentree
Copy link
Contributor

Make sure your terminal is utf8.

@dfbb
Copy link
Author

dfbb commented Jan 15, 2021

My terminal is Utf8, and BASH LANG=zh_CN.UTF8
It show UTF8 character without problem.
the problem is input through libtelnet will be wrong.

@thefallentree
Copy link
Contributor

libtelnet does not deal with encodings, it just sends whatever it is received. So it is your telnet client doesn’t send proper utf8 strings, try use iterm2 and possibly try to install telnet from brew instead

@dfbb
Copy link
Author

dfbb commented Jan 18, 2021

it is brew telnet, when using linux telnet , everything is fine.

@dfbb
Copy link
Author

dfbb commented Jan 18, 2021

it seems that mud server fluffos doesn't do Locale setting.

@dfbb
Copy link
Author

dfbb commented Jan 18, 2021

#25 have same problem

@dfbb
Copy link
Author

dfbb commented Jan 18, 2021

using nc -v localhost 6666 to connect, it have no utf8 input problem.

@XMLSDK
Copy link

XMLSDK commented Feb 1, 2021

Using telnet client of libtelnet, when I send 2 UTF8 Chinese word "火锅", it send
"<0xE7><0x81><0xAB><0xE9><0x94><0x85>", which can be correctly printed as "火锅".
Using telnet of Mac to connect to telnet-proxy, when I type the same word, it sends
"<0x67><0x01><0x2B><0x69><0x05>", which cannot be printed correctly.

From that #25 example, the binary bytes of UTF-8 of "火锅" are:
<1110 0111><1000 0001><1010 1011><1110 1001><1001 0100><1000 0101>

And the binary bytes sent by mac telnet are:
<0110 0111><0000 0001><0010 1011><0110 10001>< missing ><0000 0101>

It seems that all the 8th bits are cleared to zero. So it may be related to .inputrc settings. You may set these in ~/.inputrc to enable 8-bit input:

set meta-flag on
set convert-meta off
set input-meta on
set output-meta on

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants