wifi-presence icon indicating copy to clipboard operation
wifi-presence copied to clipboard

SSID with mixed UTF-8 and ASCII characters cannot be handled correctly

Open zhangjingye03 opened this issue 2 years ago • 2 comments

Hi Adam,

Thanks for this great integration!

However, my WiFi SSID begins with UTF-8 character and then ASCII one, like ω=2πf. In this case, status from hostapd_cli gives something below, which mixes \x and normal ASCII chars.

ssid[0]=\xcf\x89=2\xcf\x80f

https://github.com/awilliams/wifi-presence/blob/b2b64ea8bce28ef5047b66c9929817240f65bc36/internal/hostapd/status.go#L58-L67

The code above just replace \x and then decode hex, which still contains non-hex chars, resulting Error: encoding/hex: invalid byte on my device. I'm not familiar with golang though, but maybe we could use strconv.Unquote instead? (Ref)

Thanks

zhangjingye03 avatar Aug 18 '22 06:08 zhangjingye03

Thank you for the detailed report @zhangjingye03, and sorry you are experiencing that issue.

I believe you've identified the section of code responsible for this issue. I'll take a closer look in the coming days and hopefully will have a fix soon.

awilliams avatar Sep 09 '22 17:09 awilliams

@zhangjingye03 I've added a fix (#8) for your issue. Please, if you can, try out v0.2.0 and let me know if it fixes your issue. Thanks

awilliams avatar Sep 14 '22 01:09 awilliams

Closing. Please re-open @zhangjingye03 if you experience any related issues.

awilliams avatar Nov 21 '22 03:11 awilliams