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

It fails to differentiate SSIDs with Unicode and ones without.

Open issuefiler opened this issue 1 year ago • 0 comments
trafficstars

Expected behavior

WiFi.scan() should be able to differentiate the two SSIDs “🧊” (4 octets in UTF-8) and “F09FA78A” (8 octets).

Wi-Fi access points with two different SSIDs

Current behavior

> netsh wlan show networks
Interface name : Wi-Fi
There are 5 networks currently visible.

……

SSID 3 : F09FA78A
    Network type            : Infrastructure
    Authentication          : WPA2-Personal
    Encryption              : CCMP

SSID 4 : F09FA78A
    Network type            : Infrastructure
    Authentication          : WPA2-Personal
    Encryption              : CCMP

……
import WiFi from "node-wifi";

WiFi.init({iface: null});
console.log(await WiFi.scan());
……
{
    mac: '28:cd:c1:0e:50:82',
    bssid: '28:cd:c1:0e:50:82',
    ssid: 'F09FA78A',
    channel: 3,
    frequency: 2422,
    signal_level: -67.5,
    quality: 65,
    security: 'WPA2-Personal',
    security_flags: 'CCMP ',
    mode: 'Unknown'
},
{
    mac: '28:cd:c1:0e:50:80',
    bssid: '28:cd:c1:0e:50:80',
    ssid: 'F09FA78A',
    channel: 3,
    frequency: 2422,
    signal_level: -60,
    quality: 80,
    security: 'WPA2-Personal',
    security_flags: 'CCMP ',
    mode: 'Unknown'
}
……

Which are the affected features

  • [ ] node API
  • [ ] CLI

Which is your operating system?

Windows

Environment

Windows

Version of node-wifi

2.0.16

Steps to Reproduce

Have two Wi-Fi access points with the different SSIDs “🧊” (4 octets in UTF-8) and “F09FA78A” (8 octets), and try scanning them with this Node.js package in Windows.

Solutions

By not relying on netsh and calling the native Wi-Fi Windows API instead.

issuefiler avatar Feb 01 '24 06:02 issuefiler