Index: sbin/ifconfig/ifieee80211.c =================================================================== --- sbin/ifconfig/ifieee80211.c +++ sbin/ifconfig/ifieee80211.c @@ -90,6 +90,8 @@ #include #include #include /* NB: for offsetof */ +#include +#include #include "ifconfig.h" @@ -5392,7 +5394,8 @@ if (isspace(buf[i])) hasspc++; } - if (i == len) { + if (i == len || (setlocale(LC_ALL, "") != NULL && + strncmp("UTF-8", nl_langinfo(CODESET), 5) == 0)) { if (hasspc || len == 0 || buf[0] == '\0') printf("\"%.*s\"", len, buf); else