sebhildebrandt / systeminformation

System Information Library for Node.JS
MIT License
2.75k stars 311 forks source link

It's not support utf8 string? #837

Closed PublicWorld closed 1 year ago

PublicWorld commented 1 year ago

I try to get the wifi status, but the wifi name cannot be displayed here, it is a Chinese character, is there a way to display it? And I found it can be shown from wifiConnections method, but can't shown in wifiNetworks list.

Thanks!

image image
sebhildebrandt commented 1 year ago

@PublicWorld … looks that what we see here is inside a browser? Would it be possible, that you pull the master branch from github and inside the project directory run from the command line:

npm run test

Then press x and w to get WIFI connections and WIFI networks and post both results here (as TEXT).

And what I also need: what OS, OS distro/version and systeminformation version you are on? You can just also press y and o and post the result, then I see all I need.

PublicWorld commented 1 year ago
image

Same result.

my macOS version 13.4

image
PublicWorld commented 1 year ago

But when I input x, seems the ssid name is normal.

image
sebhildebrandt commented 1 year ago

@PublicWorld thank you! So you are running on macOS wich means we are in the UTF8 world by default. In Windows this is a problem but with Unix/Linux we are safe here ;-) And in nodeJS the default encoding in the exec command is utf8.

So we need to see what the underlying command returns back. Can you post the result of:

/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s -x

Thank you in advance.

PublicWorld commented 1 year ago

Thanks for your response! Please refer to this plist in this zip file, seems I still got the messy string by above terminal command.

image

a.plist.zip

sebhildebrandt commented 1 year ago

@PublicWorld thank you!!!! This helps a lot!So Airport is messing it up and has the wrong decoding here.

BUT: as the SSID Key has the correct name encoded as base64:

5rKh5LqGIFdpRmkg5L2g5bCx5rS75LiN5LqG77yf 
--> 
没了 WiFi 你就活不了?

So I could use this. I am just wondering about the question mark. I this intended?

I am unfortunately offline now for a few days, but I will try to implement this as soon as possible.

PublicWorld commented 1 year ago

Yes, this is the correct Chinese character. You don't have to rush it. Just update this when you have time. Thank you so much!

sebhildebrandt commented 1 year ago

@PublicWorld ... just published version 5.19.1. Can you test it on your side? Thank you in advance.

PublicWorld commented 1 year ago

Oh great! Thanks bro.

Sent from my iPhone

------------------ Original ------------------ From: Sebastian Hildebrandt @.> Date: Wed, Aug 23, 2023 1:35 PM To: sebhildebrandt/systeminformation @.> Cc: Dev @.>, Mention @.> Subject: Re: [sebhildebrandt/systeminformation] It's not support utf8 string?(Issue #837)

@PublicWorld ... just published version 5.19.1. Can you test it on your side? Thank you in advance.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

sebhildebrandt commented 1 year ago

@PublicWorld ... closing it for now. If you discover any issues, please feel free to reopen it.