Skip to content

Commit 31470a6

Browse files
committed
Use TextDecoder for toString('utf8')
1 parent f52dffd commit 31470a6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ function slowToString (encoding, start, end) {
522522

523523
case 'utf8':
524524
case 'utf-8':
525-
return utf8Slice(this, start, end)
525+
return new TextDecoder(encoding).decode(this.slice(start, end))
526526

527527
case 'ascii':
528528
return asciiSlice(this, start, end)

0 commit comments

Comments
 (0)