Reading strings as UTF-8

Solves issue GH-1
This commit is contained in:
Jeroen De Meerleer 2019-02-12 15:37:53 +01:00
parent b61d9d577c
commit 5730f2c089
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6

View File

@ -347,7 +347,7 @@ class Sws extends SwsModel
} }
// PlayerNames // PlayerNames
$length = (Integer)$sws->getBinaryData("NewNamePos") + 0; $length = (Integer)$sws->getBinaryData("NewNamePos") + 0;
$sws->setBinaryData("PlayerNames", self::ReadData('String', substr($swscontents, $offset, $length))); $sws->setBinaryData("PlayerNames", substr($swscontents, $offset, $length));
$offset += $length; $offset += $length;
for ($i = 0; $i < $sws->getBinaryData("NewPlayer"); $i++) { for ($i = 0; $i < $sws->getBinaryData("NewPlayer"); $i++) {
@ -524,7 +524,7 @@ class Sws extends SwsModel
if ($data == '') { if ($data == '') {
return (is_null($default)) ? '' : $default; return (is_null($default)) ? '' : $default;
} }
return $data; return iconv('windows-1252', 'utf-8', $data);
break; break;
case 'Hex': case 'Hex':
case 'Int': case 'Int':