mauricesvay / node-wifiscanner

Scan surrounding WiFi access points with NodeJS
59 stars 80 forks source link

Compensation for double byte chars in ssid #19

Closed sy1vain closed 8 years ago

sy1vain commented 8 years ago

Using the Airport module on Mac I ran across a network which had an ë in the name. Which indents some lines in the output of airport (because of the double bytes):

                            SSID BSSID             RSSI CHANNEL HT CC SECURITY (auth/unicast/group)
                         linksys 00:1e:e5:00:84:9c -89  6       Y  GB NONE
                # WiFi Poëzie # 14:cc:20:f8:9b:d2 -54  11      Y  -- NONE
                       appelboom 28:37:37:43:ee:cc -44  1       Y  NL WPA2(PSK/AES/AES)

By counting the actual bytes in the string and comparing that to the string length we can offset the substr calls so all info is correct again.

mauricesvay commented 8 years ago

Thanks for the PR!