Skip to content

Commit 8fab57a

Browse files
committed
fix: wrongly encoded fields during netdiscovery or netinventory tasks
Closes #653
1 parent fd68f16 commit 8fab57a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Changes

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ netdiscovery/netinventory:
5252
meaning RemoteInventory was functionnal only if at least ping works or the
5353
targeted computer was in the same network (arp works).
5454
* Add support for Socomec PDU
55+
* fix #653: Some values like LOCATION or CONTACT can be wrongly encoded
5556

5657
deploy:
5758
* Force agent to run a partial software inventory after the deploy task is done

lib/GLPI/Agent/Tools/SNMP.pm

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ use strict;
44
use warnings;
55
use base 'Exporter';
66

7+
use Encode qw(decode);
8+
79
use GLPI::Agent::Tools;
810

911
our @EXPORT = qw(
@@ -56,7 +58,8 @@ sub getCanonicalString {
5658
# Finally cleanup EOL if some is remaining at the end
5759
chomp($value);
5860

59-
return $value;
61+
# Finally return decoded string
62+
return decode('UTF-8', $value);
6063
}
6164

6265
sub getCanonicalMacAddress {

0 commit comments

Comments
 (0)