]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r335757:
authorkevans <kevans@FreeBSD.org>
Mon, 16 Jul 2018 14:42:45 +0000 (14:42 +0000)
committerkevans <kevans@FreeBSD.org>
Mon, 16 Jul 2018 14:42:45 +0000 (14:42 +0000)
commitadc9f857a43afb4845dd54c4bb25d51fdaaee492
tree8794e8b30e2c0425968c772395c51e917f3bc13c
parent82a02a0d4343c5686d5849ae3810a86569314c97
MFC r335757:

ifconfig(8): Attempt to render non-printable sequences w/ UTF-8 Environment

Currently ifconfig(8) only prints the hex representation of ssid names
with non-ASCII characters. Many modern terminals are able to properly render
non-ASCII characters. This change checks if the terminal charmap is UTF-8,
and if so, will render the characters, rather than the hex value.

This behavior is circumvented by running ifconfig(8) in a non-UTF8 locale;
e.g. C or POSIX.

It was pointed out by kp@ during the review that APs have the option to
broadcast whether their SSIDs may be interpreted as UTF-8. Ideally, we would
honor this and only attempt this behavior if it's so-broadcasted by the AP.

However, a sample survey showed that hostapd will advertise this if
indicated in config but it doesn't seem to be so common in the AP market, so
this would be effectively useless as we'll rarely know if the SSID should be
renderable as UTF-8.

Despite this, it was decided to be OK with this anyways- there's a
straightforward path to doing it the right way based on advertisement by AP
if we need to go that route, and one can revert to old behavior easily
enough at runtime if we get it wrong.
sbin/ifconfig/ifieee80211.c