Commit e07f3ec
committed
fix: fix SSID encoding issues with GBK/UTF-8 detection
1. Add decodeByteArray() utility function to handle mixed GBK and UTF-8
encoded SSIDs
2. Replace direct ssid() calls with decodeByteArray(rawSsid()) in
NetworkManager backend
3. Update copyright years to 2026 in affected files
4. Fix potential SSID mismatch issues when comparing wireless settings
with network SSIDs
The NetworkManager Qt API's ssid() method may return incorrectly decoded
strings when
access points use GBK encoding (common with Chinese routers). This
change introduces
intelligent encoding detection that tries UTF-8 first, then falls back
to GBK if
invalid characters are detected, ensuring proper display and matching
of SSIDs
with non-ASCII characters.
Influence:
1. Test WiFi scanning with access points using Chinese SSID names (GBK
encoded)
2. Test WiFi scanning with access points using UTF-8 encoded SSIDs
3. Verify SSID matching for saved connections with non-ASCII characters
4. Test hidden network detection with various SSID encodings
5. Verify active connection status display shows correct SSID names
6. Test hotspot functionality with non-ASCII SSID names
fix: 修复 SSID 编码问题,支持 GBK/UTF-8 自动检测
1. 添加 decodeByteArray() 工具函数处理混合 GBK 和 UTF-8 编码的 SSID
2. 在 NetworkManager 后端中将直接调用 ssid() 替换为
decodeByteArray(rawSsid())
3. 更新受影响文件的版权年份至 2026
4. 修复无线设置与网络 SSID 比较时可能出现的编码不匹配问题
NetworkManager Qt API 的 ssid() 方法在接入点使用 GBK 编码时(常见于中文
路由器)
可能返回错误解码的字符串。此变更引入智能编码检测,优先尝试 UTF-8 解码,
检测到无效字符时回退到 GBK 解码,确保非 ASCII 字符的 SSID 正确显示和
匹配。
Influence:
1. 测试使用中文 SSID 名称(GBK 编码)的 WiFi 扫描功能
2. 测试使用 UTF-8 编码 SSID 的 WiFi 扫描功能
3. 验证非 ASCII 字符的已保存连接 SSID 匹配功能
4. 测试各种 SSID 编码下的隐藏网络检测功能
5. 验证活动连接状态显示正确的 SSID 名称
6. 测试使用非 ASCII SSID 名称的热点功能
PMS: BUG-3578431 parent 4911489 commit e07f3ec
5 files changed
Lines changed: 30 additions & 10 deletions
File tree
- src
- impl/networkmanager
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
184 | | - | |
| 184 | + | |
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
718 | 718 | | |
719 | 719 | | |
720 | 720 | | |
721 | | - | |
| 721 | + | |
722 | 722 | | |
723 | 723 | | |
724 | 724 | | |
| |||
1081 | 1081 | | |
1082 | 1082 | | |
1083 | 1083 | | |
1084 | | - | |
| 1084 | + | |
1085 | 1085 | | |
1086 | 1086 | | |
1087 | 1087 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
64 | | - | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
78 | 94 | | |
79 | 95 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
0 commit comments