Dear maintainer,

I've made a simple TCP server using the `java.net` package for a test and
established a connection to the server by `telnet -L8 {host} {port}`
command. Entered some Korean characters which are usually handled with
UTF-8 encodings, some letters were normally sent but some were not. If I
write '녕' and press Enter, for example, server gets '�' and it's not an
encoding issue.

1. Cases
If the characters are handled correctly, the packet containing it as its
data must have the hex encoded characters and CRLF. Some Korean letters,
like '안'(0xec 0x95 0x88) is transferred well, but some korean letters like
'녕'(0xeb 0x85 0x95) are not handled properly.

(1) normal case
If I make a telnet connection with server and send '안'(0xec 0x95 0x88), the
packet made contains data `ec 95 88 0d 0a` which means `안\r\n`.

(2) abnormal case 1: missing data
When I enter '녕'(0xeb 0x85 0x95), i get two packets and each of them
contains `eb` and `95 0d 0a` as data with '85' missing. I wonder if telnet
treats 0x85 as an escape letter or something. There are several letters
causing this kind of issue, with splitting into a number of packets with
certain hex code as the delimiter.

(3) abnormal case 2: corrupted data
When I entered '요'(0xec 0x9a 0x94) I expected the data to be `ec 9a 94 0d
0a` in a single packet. But I got two packets, containing data `ec ff ed ff
fd 06` and `94 0d 0a` each. I don't understand why 0x9a was replaced with
unexpected `ff ed ff fd 06`.

2. Environment
I'm using M1 Macbook (2020), and these are the detailed information below.

* Chip - Apple M1
* Memory - 16GB
* OS - MacOS Sequoia v15.1.1(24B91)
* Locale Environment Variables
```

$ locale
LANG="ko_KR.UTF-8"
LC_COLLATE="ko_KR.UTF-8"
LC_CTYPE="ko_KR.UTF-8"
LC_MESSAGES="ko_KR.UTF-8"
LC_MONETARY="ko_KR.UTF-8"
LC_NUMERIC="ko_KR.UTF-8"
LC_TIME="ko_KR.UTF-8"
LC_ALL="ko_KR.UTF-8"
```
* Terminal - MacOS Terminal v2.14(455)
* inetutils - stable 2.5 (bottled)

I'm reporting these issues, but I'm also wondering if this is
unsupported/unintended usage
If there is anything that I should inform or get noticed, please let me
know.
ᐧ

Reply via email to