wireless
wireless copied to clipboard
Wireless.py cannot parse wireless network names with Unicode characters
Hi,
My wireless network has an Emoji in it:
$ /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I \
> | grep " SSID"
SSID: 🐳 Big Whale Network
This seems to break Wireless.py's parsing for the wireless name? Some suggested possible fixes include setting "utf-8" for the decode()
call or having the regex match more than ASCII characters?
The error is below (I'm on macOS 10.12.2 and Python 2.7.12):
File "/usr/local/lib/python2.7/site-packages/wireless/Wireless.py", line 11, in cmd
stdout=subprocess.PIPE, stderr=subprocess.STDOUT
UnicodeDecodeError: 'ascii' codec can't decode byte 0xf0 in position 23: ordinal not in range(128)
@tbodt @kylemcdonald reference: https://github.com/kylemcdonald/FreeWifi/issues/13#issuecomment-279052108
The regex indicated is unrelated to the problem, it's only for extracting the version number of nmcli
which is only useful on Ubuntu.
I don't know if there is a standard encoding for wifi names, if there is it should be used instead of utf8.