From 5730f2c08950a6c3b0d43540f2dce36fb3f66968 Mon Sep 17 00:00:00 2001 From: Jeroen De Meerleer Date: Tue, 12 Feb 2019 15:37:53 +0100 Subject: [PATCH] Reading strings as UTF-8 Solves issue GH-1 --- src/Sws.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Sws.php b/src/Sws.php index a4c0a9e..ef5500f 100644 --- a/src/Sws.php +++ b/src/Sws.php @@ -347,7 +347,7 @@ class Sws extends SwsModel } // PlayerNames $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; for ($i = 0; $i < $sws->getBinaryData("NewPlayer"); $i++) { @@ -524,7 +524,7 @@ class Sws extends SwsModel if ($data == '') { return (is_null($default)) ? '' : $default; } - return $data; + return iconv('windows-1252', 'utf-8', $data); break; case 'Hex': case 'Int':