diff --git a/composer.json b/composer.json index d2d2173..42d5272 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,8 @@ } }, "require": { - "php": ">=7.2" + "php": ">=7.2", + "ext-mbstring": "*" }, "require-dev": { "phpunit/phpunit": "^8", diff --git a/src/BencodeTorrent.php b/src/BencodeTorrent.php index 2a91e87..0b50f3b 100644 --- a/src/BencodeTorrent.php +++ b/src/BencodeTorrent.php @@ -45,7 +45,7 @@ class BencodeTorrent extends Bencode private function setDelim(): void { if (self::$utf8_filelist_delim === null) { - self::$utf8_filelist_delim = utf8_encode(chr(self::FILELIST_DELIM)); + self::$utf8_filelist_delim = mb_convert_encoding(chr(self::FILELIST_DELIM), 'UTF-8', 'ISO-8859-1'); } }