librenms/LibreNMS
Tony Murray 8a883140cb
Infer character encoding for ifAlias and sysLocation (#13248)
* Infer character encoding for ifAlias and sysLocation
Tries to convert character encoding for non-UTF-8 encoded strings.
This will only work for snmp strings that are type-hinted, not ones forced to ASCII with -Oa or similar
Only works for your default charset or Windows-1251 or LATIN1.
You can set your character encoding in .env with CHARSET

Please save us all and just use UTF-8

* style fixes

* less Yoda

* ensure return type

* fall back to passed string

* don't convert strings with any unprintable characters (such as line return)

* Update LibreNMS/Util/StringHelpers.php

Co-authored-by: Jellyfrog <Jellyfrog@users.noreply.github.com>

* Fix CP850

* fix space

Co-authored-by: Jellyfrog <Jellyfrog@users.noreply.github.com>
2021-09-21 08:47:44 -05:00
..
Alert Fix PagerDuty transport's group field (#13235) 2021-09-13 21:14:11 +02:00
Alerting Apply fixes from StyleCI (#13224) 2021-09-10 20:09:53 +02:00
Authentication Apply fixes from StyleCI (#13224) 2021-09-10 20:09:53 +02:00
Cache Apply fixes from StyleCI (#13224) 2021-09-10 20:09:53 +02:00
Data Apply fixes from StyleCI (#13224) 2021-09-10 20:09:53 +02:00
DB Apply fixes from StyleCI (#13224) 2021-09-10 20:09:53 +02:00
Device Apply fixes from StyleCI (#13224) 2021-09-10 20:09:53 +02:00
Enum Apply fixes from StyleCI (#13224) 2021-09-10 20:09:53 +02:00
Exceptions Apply fixes from StyleCI (#13224) 2021-09-10 20:09:53 +02:00
Interfaces Apply fixes from StyleCI (#13224) 2021-09-10 20:09:53 +02:00
Modules Fix mempool unit display (#13241) 2021-09-15 17:45:57 +02:00
OS Infer character encoding for ifAlias and sysLocation (#13248) 2021-09-21 08:47:44 -05:00
RRD Apply fixes from StyleCI (#13224) 2021-09-10 20:09:53 +02:00
Snmptrap Veeam backup SNMP Traps (#13170) 2021-09-19 08:21:31 -05:00
Util Infer character encoding for ifAlias and sysLocation (#13248) 2021-09-21 08:47:44 -05:00
Validations Apply fixes from StyleCI (#13224) 2021-09-10 20:09:53 +02:00
__init__.py Revert "Full Python code fusion / refactor and hardening (#13094)" (#13123) 2021-08-10 15:13:05 -05:00
Component.php Apply fixes from StyleCI (#13224) 2021-09-10 20:09:53 +02:00
ComposerHelper.php Apply fixes from StyleCI (#13224) 2021-09-10 20:09:53 +02:00
Config.php Apply fixes from StyleCI (#13224) 2021-09-10 20:09:53 +02:00
Fping.php Apply fixes from StyleCI (#13224) 2021-09-10 20:09:53 +02:00
IRCBot.php Bump larastan (#13071) 2021-07-26 09:00:34 -05:00
library.py Revert "Full Python code fusion / refactor and hardening (#13094)" (#13123) 2021-08-10 15:13:05 -05:00
Model.php Apply fixes from StyleCI (#13208) 2021-09-08 23:35:56 +02:00
ObjectCache.php Apply fixes from StyleCI (#13224) 2021-09-10 20:09:53 +02:00
OS.php Apply fixes from StyleCI (#13224) 2021-09-10 20:09:53 +02:00
Plugins.php Apply fixes from StyleCI (#13224) 2021-09-10 20:09:53 +02:00
Proc.php Apply fixes from StyleCI (#13224) 2021-09-10 20:09:53 +02:00
queuemanager.py Revert "Full Python code fusion / refactor and hardening (#13094)" (#13123) 2021-08-10 15:13:05 -05:00
RRDRecursiveFilterIterator.php Apply fixes from StyleCI (#13224) 2021-09-10 20:09:53 +02:00
service.py Revert "Full Python code fusion / refactor and hardening (#13094)" (#13123) 2021-08-10 15:13:05 -05:00
Services.php Swich links to https (#12511) 2021-02-09 00:29:04 +01:00
ValidationResult.php Apply fixes from StyleCI (#13224) 2021-09-10 20:09:53 +02:00
Validator.php Apply fixes from StyleCI (#13224) 2021-09-10 20:09:53 +02:00