Encode NetBIOS name, domain, user as UTF-8

This commit is contained in:
Eric A. Miller
2014-07-21 20:57:40 -04:00
parent e991a64234
commit 657eb7fe7b
2 changed files with 10 additions and 3 deletions

View File

@@ -6,6 +6,7 @@ use Dancer::Plugin::DBIC 'schema';
use App::Netdisco::Util::Node 'check_mac';
use NetAddr::IP::Lite ':lower';
use App::Netdisco::AnyEvent::Nbtstat;
use Encode;
use base 'Exporter';
our @EXPORT = ();
@@ -131,10 +132,10 @@ sub _filter_nbname {
$hash_ref->{'ip'} = $ip;
$hash_ref->{'mac'} = $mac;
$hash_ref->{'nbname'} = $nbname;
$hash_ref->{'domain'} = $domain;
$hash_ref->{'nbname'} = Encode::decode('UTF-8', $nbname);
$hash_ref->{'domain'} = Encode::decode('UTF-8', $domain);
$hash_ref->{'server'} = $server;
$hash_ref->{'nbuser'} = $nbuser;
$hash_ref->{'nbuser'} = Encode::decode('UTF-8', $nbuser);
return;
}