You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix: handle GBK-encoded interface names and descriptions in ports polling (librenms#19528)
* Fix: handle GBK-encoded interface names and descriptions in ports polling
When SNMP returns GBK-encoded Chinese interface names (ifName/ifDescr),
they fail to decode as UTF-8 and become empty or garbled. This patch
adds multi-tier encoding support:
1. StringHelpers::inferEncoding() now prioritizes GB18030/GBK/GB2312
fallbacks before Western encodings (Windows-1252/CP850), preventing
mojibake when devices return non-UTF-8 interface descriptions.
2. Port polling/discovery explicitly applies inferEncoding() to
ifName and ifDescr fields (consistent with ifAlias handling).
Fixes interfaces appearing with empty names like "ifName: -> "
when devices use GBK encoding for interface aliases.
Co-authored-by: Copilot <copilot@github.com>
* Fix: prevent encoding detection conflicts between Western and GB codecs
Co-authored-by: Copilot <copilot@github.com>
* Fix: Improve prevent encoding detection conflicts between Western and GB codecs
Co-authored-by: Copilot <copilot@github.com>
---------
Co-authored-by: Copilot <copilot@github.com>
0 commit comments