-
Notifications
You must be signed in to change notification settings - Fork 168
Description
Expected behavior
When scanning for networks, SSIDs containing umlaut characters (ä, ö, ü, ß) should be displayed correctly without any modifications.
Current behavior
All umlaut characters (ä, ö, ü, ß) in SSIDs are replaced by question marks (?).
Which are the affected features
- node API
- CLI
Which is your operating system?
Linux
Environment
Operating System: Debian GNU/Linux 12 (Bookworm)
Node.js Version: v20.12.0
Locale Settings (output of locale):
LANG=
LANGUAGE=de_DE
LC_CTYPE="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_PAPER="C.UTF-8"
LC_NAME="C.UTF-8"
LC_ADDRESS="C.UTF-8"
LC_TELEPHONE="C.UTF-8"
LC_MEASUREMENT="C.UTF-8"
LC_IDENTIFICATION="C.UTF-8"
LC_ALL=C.UTF-8
Version of node-wifi
v2.0.16
Steps to Reproduce
- Ensure a network with the SSID
Schöpfgefäßis available and visible to the device. - Run
wifi.scan()as described in the node-wifi Getting Started Guide. - Inspect the returned list of networks. The network with the SSID
Schöpfgefäßwill appear with itsSSIDproperty displayed asSch?pfgef??.
Solutions
Our current workaround involves patching the module after installation. Specifically, we remove the following line (line 3):
LC_ALL: 'en_US.UTF-8',
from the file node_modules/node-wifi/src/env.js.
This line is part of the environment configuration object. Removing it prevents the environment from being forcibly set to en_US.UTF-8, allowing the system's default locale (C.UTF-8 in our case) to correctly handle umlaut characters in SSIDs.
Potential long-term solution:
To improve flexibility, this hardcoded locale setting could be made configurable via an option in the module's API. This would allow users to adapt the environment settings to their specific locale requirements without needing to patch the code manually.