Date: Tue, 18 Oct 2022 15:17:49 +0800 From: =?UTF-8?B?5ZCz5oGp57ev?= <rickywu0421@gmail.com> To: freebsd-hackers@freebsd.org Subject: Re: ifconfig(8) IEEE802.11 SSID format Message-ID: <CAM71UgdAx2s2JfLV=ujrq7CWJgW%2BYznr8nbURg=tTX09hL%2B1Qw@mail.gmail.com> In-Reply-To: <CAM71UgdWKY_zeY-p14CpV2Tc%2BRuzWsorgcZxXmmhk8u15rOKig@mail.gmail.com> References: <CAM71UgdWKY_zeY-p14CpV2Tc%2BRuzWsorgcZxXmmhk8u15rOKig@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] Sorry for not explaining the whole situation. The previous email was asking for everyone about how to solve the problem explained in it, and I also introduced a way to deal with it, which may or may not be adopted. 吳恩緯 <rickywu0421@gmail.com> 於 2022年10月18日 週二 上午11:25寫道: > 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. > [-- Attachment #2 --] <div dir="ltr">Sorry for not explaining the whole situation.<div><br></div><div>The previous email was asking for everyone about how to solve the problem explained in it, and I also introduced a way to deal with it, which may or may not be adopted.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">吳恩緯 <<a href="mailto:rickywu0421@gmail.com">rickywu0421@gmail.com</a>> 於 2022年10月18日 週二 上午11:25寫道:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">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. <div><br></div><div>Here is the possible way to 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 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.</div></div> </blockquote></div>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAM71UgdAx2s2JfLV=ujrq7CWJgW%2BYznr8nbURg=tTX09hL%2B1Qw>
