Skip to content

Commit 85476a0

Browse files
wrong encoding for string length
1 parent 350f252 commit 85476a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PackStream/v1/Packer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function pack($signature, ...$params): Generator
5050
}
5151

5252
//structure buffer
53-
$len = mb_strlen($output, 'UTF-8');
53+
$len = mb_strlen($output, '8bit');
5454
for ($i = 0; $i < $len; $i += 65535) {
5555
$chunk = mb_substr($output, $i, 65535, '8bit');
5656
yield pack('n', mb_strlen($chunk, '8bit')) . $chunk;

0 commit comments

Comments
 (0)