Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Umlaut characters not handled correctly in network names (SSID) #198

Open
1 of 2 tasks
wilhelmmueller opened this issue Nov 27, 2024 · 0 comments
Open
1 of 2 tasks

Comments

@wilhelmmueller
Copy link

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

  1. Ensure a network with the SSID Schöpfgefäß is available and visible to the device.
  2. Run wifi.scan() as described in the node-wifi Getting Started Guide.
  3. Inspect the returned list of networks. The network with the SSID Schöpfgefäß will appear with its SSID property displayed as Sch?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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant