Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Oct 2022 11:25:30 +0800
From:      =?UTF-8?B?5ZCz5oGp57ev?= <rickywu0421@gmail.com>
To:        freebsd-hackers@freebsd.org
Subject:   ifconfig(8) IEEE802.11 SSID format
Message-ID:  <CAM71UgdWKY_zeY-p14CpV2Tc%2BRuzWsorgcZxXmmhk8u15rOKig@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
--000000000000b5b39905eb46a520
Content-Type: text/plain; charset="UTF-8"

Currently `ifconfig wlanX scan` will show SSID in hex when the scanned SSID
is non-printable. And the non-printable character is when the character
with value < 32 or value >= 126 in ifconfig(8)'s implementation. That leads
to a problem that other languages using UTF-8 or other encoding will be
treated as non-printable in ifconfig(8), thus not printed on screen.

Here is the possible way to solve the problem:
When a SSID is going to be printed, copy the byte stream (uint8_t *) into
wide character stream (wchar_t *), and use libc iswprint(3) to check
whether characters are printable or non-printable. I have tested this and
it is workable when the locale is correctly set.

--000000000000b5b39905eb46a520
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Currently `ifconfig wlanX=C2=A0scan` will show SSID in hex=
 when the scanned SSID is non-printable. And the non-printable character is=
 when the character with value &lt; 32 or value &gt;=3D 126 in ifconfig(8)&=
#39;s implementation. That leads to a problem that other languages using UT=
F-8 or other encoding will be treated as non-printable in ifconfig(8), thus=
 not printed on screen.=C2=A0<div><br></div><div>Here is the possible way t=
o solve the problem:</div><div>When a SSID is going to be printed, copy the=
 byte stream (uint8_t *) into wide character stream (wchar_t *), and use li=
bc iswprint(3) to check whether characters are printable or non-printable. =
I have tested this and it is workable when the locale is correctly set.</di=
v></div>

--000000000000b5b39905eb46a520--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAM71UgdWKY_zeY-p14CpV2Tc%2BRuzWsorgcZxXmmhk8u15rOKig>