Skip to content

Commit

Permalink
reduce code duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
guillomovitch committed May 15, 2012
1 parent 21b1108 commit 4f94b2f
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions lib/FusionInventory/Agent/Tools/Win32.pm
Expand Up @@ -51,15 +51,11 @@ sub is64bit {

sub getLocalCodepage {
if (!$localCodepage) {
my $lmachine = $Registry->Open('LMachine', {
Access => KEY_READ
}) or die "Can't open HKEY_LOCAL_MACHINE key: $EXTENDED_OS_ERROR";

my $codepage =
$lmachine->{"SYSTEM\\CurrentControlSet\\Control\\Nls\\CodePage"}
or warn;

$localCodepage = "cp".$codepage->{ACP};
$localCodepage =
"cp" .
getRegistryValue(
path => "SYSTEM\CurrentControlSet\Control\Nls\CodePage\ACP"
);
}

return $localCodepage;
Expand Down

0 comments on commit 4f94b2f

Please sign in to comment.