Skip to content

Commit 92d8a38

Browse files
committed
avoid utf-8 buffer re-decoding
1 parent 6c436ae commit 92d8a38

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bits/40_harb.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ var PRN = (function() {
947947
default: throw new Error("Unrecognized type " + opts.type);
948948
}
949949
if(bytes[0] == 0xEF && bytes[1] == 0xBB && bytes[2] == 0xBF) str = utf8read(str.slice(3));
950-
else if(opts.type != 'string' && opts.codepage == 65001) str = utf8read(str);
950+
else if(opts.type != 'string' && opts.type != 'buffer' && opts.codepage == 65001) str = utf8read(str);
951951
else if((opts.type == 'binary') && typeof cptable !== 'undefined' && opts.codepage) str = cptable.utils.decode(opts.codepage, cptable.utils.encode(28591,str));
952952
if(str.slice(0,19) == "socialcalc:version:") return ETH.to_sheet(opts.type == 'string' ? str : utf8read(str), opts);
953953
return prn_to_sheet_str(str, opts);

0 commit comments

Comments
 (0)