jless icon indicating copy to clipboard operation
jless copied to clipboard

Korean not supported

Open roeniss opened this issue 2 years ago • 5 comments

Hi, I use Korean (ko_kr) but seems that jless doesn't support this language. given:

echo '{"hello":"헬로"}' | jless

expected:

{"hello":"헬로"}

result:

{"hello":"<ED><97><AC><EB><A1><9C>"}

roeniss avatar Mar 12 '22 07:03 roeniss

Hm, I can't reproduce on my machine. Can you provide more details about your terminal and environment? Do you know what text encoding your terminal is using? Those hex codes are the bytes used when that text is encoded with UTF-8, which leads me to suspect it is a character encoding issue.

Can you give the values of the LC_CTYPE, LANG, and LANGUAGE environmental variables, and providing the outputs of locale charmap and stty -a? (I just gathered some options from this Stack Overflow post for determining the encoding of a terminal.)

PaulJuliusMartinez avatar Mar 12 '22 23:03 PaulJuliusMartinez

I didn't think like that. Let me answer you:

$ pi@raspberrypi:~ $ echo $LC_TYPE "/" $LANG "/" $LANGUAGE
/ en_US.UTF-8 /

$ pi@raspberrypi:~ $ locale charmap
UTF-8

$ pi@raspberrypi:~ $ stty -a
speed 38400 baud; rows 25; columns 80; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = M-^?; eol2 = M-^?;
swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;
lnext = ^V; discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc ixany imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke -flusho -extproc

But I'm still confused a little because below code is printed well:

$ pi@raspberrypi:~ $ echo '{"hello":"헬로"}'
{"hello":"헬로"}

roeniss avatar Mar 14 '22 17:03 roeniss

The above code was run on my raspberry pi 4B+. I will add my macOS' too:

❯❯❯ echo $LC_TYPE "/" $LANG "/" $LANGUAGE
/ en_US.UTF-8 /

❯❯❯ locale charmap
UTF-8

❯❯❯ stty -a
speed 38400 baud; 61 rows; 113 columns;
lflags: icanon isig iexten echo echoe echok echoke -echonl echoctl
	-echoprt -altwerase -noflsh -tostop -flusho pendin -nokerninfo
	-extproc
iflags: -istrip icrnl -inlcr -igncr ixon -ixoff ixany imaxbel iutf8
	-ignbrk brkint -inpck -ignpar -parmrk
oflags: opost onlcr -oxtabs -onocr -onlret
cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -dsrflow
	-dtrflow -mdmbuf
cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>;
	eol2 = <undef>; erase = ^?; intr = ^C; kill = ^U; lnext = ^V;
	min = 1; quit = ^\; reprint = ^R; start = ^Q; status = ^T;
	stop = ^S; susp = ^Z; time = 0; werase = ^W;

❯❯❯ echo '{"hello":"헬로"}' | jless
# works fine

roeniss avatar Mar 15 '22 03:03 roeniss

Are you ssh'ing into your raspberry through your macos? On a ssh session configurations from your terminal and the raspberry can mix, possibly causing some issues.

leoperegrino avatar Apr 15 '22 18:04 leoperegrino

@leoperegrino yes I am. Thank you for the idea.

roeniss avatar Apr 16 '22 18:04 roeniss