Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by gbr-app-1.alpinelinux.org (Postfix) with ESMTPS id 845E6225EC2 for <~alpine/users@lists.alpinelinux.org>; Fri, 27 Oct 2023 15:19:02 +0000 (UTC) Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-27db9fdec0dso1861142a91.0 for <~alpine/users@lists.alpinelinux.org>; Fri, 27 Oct 2023 08:19:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698419940; x=1699024740; darn=lists.alpinelinux.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=Zfa6In1c3cWujusUtvAO/LxOmTs7pGhK9ovdA+9pbBo=; b=Ugkeg7uuJ7lQhOS/LlL0yoim9Qwc2WL5w7vl6dgmGwaebGE8I4xm+yWHBDj50CBHe2 BKSCFMmnj4+WtjzvIzgdaXD+TCgXNYzPFQ6atrKwiI423oLvQC5CPvJ7m9Y0DB5qf1JQ lOS3LvBIW7i18EwWb05+edRi/WmP4LTUAoP+8EhqXS2zpy5TPPHcWJo6HCe/2mf0HkL1 6Vb+l/DpdftqZvNxSFBrEhCFulA/Lv35coFMp9iUZRWVdqbNiA3vMbmP3ZS2N9WA93X4 4H/xJ2edgmkpGGG1nAB5QiTOj0PhazEMoGV4q5KUiSsONCVj2gPNu4Qn9jIFlfoNYok5 uc3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698419940; x=1699024740; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Zfa6In1c3cWujusUtvAO/LxOmTs7pGhK9ovdA+9pbBo=; b=Fi5m1rJ2e6tVnothylB4+qOFLp1dyt3qhZJC+/MoWVasVDsQ8c2j24wvTnpvwNQHkV Ah0Ip0KJsc5l8RctOZwV0O6QTg2+W/bX7+ahwPNIj2fCp7AfMc93MvrLQhgEhvO2ux5O 5R3BQdu+qECoxbtP38TecUxEUU+2oi7Xb75abY69drgo28zpBdJ5b6bM3FIVsYw8Ap9a wOSCzB6VzcXFsCBZG5bdaLYYW2kLhxRHWsYO3YtqIDzN/gmBaPng69gssKX0/jW0Tl/V DZqXMU/4aj07t3dxVcAJd7OklM7d5PwgI/P/ExTgp1oYyyDEoZXh3EbKkocOHeWITblQ DW/A== X-Gm-Message-State: AOJu0Yy0W9m9FnJo0ADahrkEWR0rBRZ/MCdbmRb0+WAdPkeW1t06Se/Y nazb/QT852qrXQCoRkSOaLr3yxEhIikhvvqVypBDt+7w8ty5CUcm X-Google-Smtp-Source: AGHT+IHVwUoNocjf2J4H+dg9sIlATW400/xE93ZSPn525k743ubFVwXQdmRihGClH9UElC8vRJbWbIVEGBJkG9CO5ts= X-Received: by 2002:a17:90b:d8d:b0:27d:4d0:d79b with SMTP id bg13-20020a17090b0d8d00b0027d04d0d79bmr3264776pjb.23.1698419940419; Fri, 27 Oct 2023 08:19:00 -0700 (PDT) MIME-Version: 1.0 From: nvim Date: Fri, 27 Oct 2023 23:18:44 +0800 Message-ID: Subject: luit 2.0 on Alpine Linux cannot convert Chinese charsets (GBK/GB2312/GB18030) correctly To: ~alpine/users@lists.alpinelinux.org Content-Type: multipart/alternative; boundary="0000000000003a6d130608b43595" --0000000000003a6d130608b43595 Content-Type: text/plain; charset="UTF-8" Greetings, I was trying to use Docker to deploy an application which uses a SSH client to log on a Chinese BBS (Bulletin Board System). Usually Chinese BBS use GBK/GB2312/GB18030 charset, so I need `Luit` ( https://invisible-island.net/luit/) to convert the output text for UTF-8 terminals. At first, I deployed my app on the Debian system, everything worked fine (by the way. Debian 11 has no Luit 2.0, I need to build it from source, while on Debian 12, Luit 2.0 has been included in the package repository). Then I tried to deploy it on Alpine. I still need to build Luit 2.0 from source. However, this time, the text displayed in the terminal looks like garbled text, closer to Korean than Chinese. *My question is, is this an Alpine Chinese charset encoding support problem or a Luit problem. And is there any locale configuration I need to do on Alpine? Could you please kindly shed some light on this please? Thanks in advance.* *On Alpine:* *I installed musl musl-utils musl-locales tzdata.* / # cat /etc/issue Welcome to Alpine Linux 3.18 Kernel \r on an \m (\l) / # ls /usr/share/locale/ cs_CZ de_DE en_US fi_FI it_IT nl_NL pt_PT sr_RS de_CH en_GB es_ES fr_FR nb_NO pt_BR ru_RU sv_SE *[No Chinese locale here.]* / # locale -m ASCII UTF-8 *[No Chinese char maps.]* / # iconv -l UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, UTF32-LE, UCS-2BE, UCS-2LE, WCHAR_T, US_ASCII, ISO8859-1, ISO8859-2, ISO8859-3, ISO8859-4, ISO8859-5, ISO8859-6, ISO8859-7, ... *[No Chinese GBK/GB2312/GB18030 charset encoding here.]* / # luit -encoding GB18030 ssh xxxxx@bbs.mysmth.net (incorrect conversion on Alpine) *On Debian:* # cat /etc/issue Debian GNU/Linux 11 \n \l # locale -m | grep GB GB18030 GB2312 GBK GB_1988-80 # iconv -l | grep GB CN-GB// CSGB2312// CSISO58GB1988// EBCDIC-CP-GB// GB// GB2312// GB13000// GB18030// GBK// GB_1988-80// GB_198880// ISO646-GB// # luit -encoding GB18030 ssh xxxxx@bbs.mysmth.net (expected conversion on Debian) Thanks, David. --0000000000003a6d130608b43595 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Greetings,

I was trying to u= se Docker to deploy an application which uses a SSH client to log on a Chin= ese BBS (Bulletin Bo= ard System). Usually Chinese BBS use GBK/GB2312/GB18030 charset, so I need = `Luit` (https://invis= ible-island.net/luit/)=C2=A0=C2=A0to convert the output text for UTF-8 terminals. At first,= I=C2=A0deployed my app on the Debian system, everything worked fine (by th= e way. Debian 11 has no Luit 2.0, I need to build=C2=A0it from source, whil= e on Debian 12, Luit 2.0 has been included in the package repository). Then= I tried to deploy it on Alpine. I still need to build Luit 2.0 from source= . However, this time, the text displayed in the terminal looks like garbled= text, closer to Korean than Chinese.

My question is, is= this an Alpine Chinese charset encoding support problem or a Luit problem.= And is there any locale configuration I need to do on Alpine? Could you pl= ease kindly shed some light on this please? Thanks in=C2=A0advance.
=
On Alpine:

I installed musl musl= -utils musl-locales tzdata.

/ # cat /etc/issue=C2=A0Welcome to Alpine Linux 3.18
Kernel \r on an \m (\l)

/ # ls /usr/share/locale/
cs_CZ =C2=A0de_DE =C2=A0en_US =C2=A0fi_FI = =C2=A0it_IT =C2=A0nl_NL =C2=A0pt_PT =C2=A0sr_RS
de_CH =C2=A0en_GB =C2=A0= es_ES =C2=A0fr_FR =C2=A0nb_NO =C2=A0pt_BR =C2=A0ru_RU =C2=A0sv_SE
=
[No Chinese locale here.]

/= # locale -m
ASCII
UTF-8
[No Chinese char map= s.]

/ # iconv -l
UTF-8, UTF-16BE= , UTF-16LE, UTF-32BE, UTF32-LE, UCS-2BE, UCS-2LE, WCHAR_T,
US_ASCII, ISO= 8859-1, ISO8859-2, ISO8859-3, ISO8859-4, ISO8859-5,
ISO8859-6, ISO8859-7= , ...
[No Chinese GBK/GB2312/GB18030 charset encodi= ng here.]

/ # luit -encoding GB18030 ssh= =C2=A0xxxxx@bbs.m= ysmth.net
(incorrect conversion on Alpine)

=
On Debian:

# cat /etc/issue
Debian GNU/Linux 11 \n = \l

# locale -m | grep GB
GB18030
GB2312<= br>GBK
GB_1988-80

# iconv -l | grep GB
C= N-GB//
CSGB2312//
CSISO58GB1988//
EBCDIC-CP-GB//
GB//
GB2312= //
GB13000//
GB18030//
GBK//
GB_1988-80//
GB_198880//
ISO= 646-GB//

# luit -encoding GB18030 ssh=C2=A0xxxxx@bbs.mysmth.net=
(expected conversion on Debian)


Thanks,
David.
--0000000000003a6d130608b43595--