Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F147075888
D15922.id44571.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
837 B
Referenced Files
None
Subscribers
None
D15922.id44571.diff
View Options
Index: head/sbin/ifconfig/ifieee80211.c
===================================================================
--- head/sbin/ifconfig/ifieee80211.c
+++ head/sbin/ifconfig/ifieee80211.c
@@ -90,6 +90,8 @@
#include <unistd.h>
#include <stdarg.h>
#include <stddef.h> /* NB: for offsetof */
+#include <locale.h>
+#include <langinfo.h>
#include "ifconfig.h"
@@ -5383,16 +5385,21 @@
{
int i;
int hasspc;
+ int utf8;
i = 0;
hasspc = 0;
+
+ setlocale(LC_CTYPE, "");
+ utf8 = strncmp("UTF-8", nl_langinfo(CODESET), 5) == 0;
+
for (; i < len; i++) {
- if (!isprint(buf[i]) && buf[i] != '\0')
+ if (!isprint(buf[i]) && buf[i] != '\0' && !utf8)
break;
if (isspace(buf[i]))
hasspc++;
}
- if (i == len) {
+ if (i == len || utf8) {
if (hasspc || len == 0 || buf[0] == '\0')
printf("\"%.*s\"", len, buf);
else
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Mar 9, 3:22 AM (20 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29428365
Default Alt Text
D15922.id44571.diff (837 B)
Attached To
Mode
D15922: Added ssid values to render UTF-8 encoded characters in ifconfig(8)
Attached
Detach File
Event Timeline
Log In to Comment