Decode utf8 text only for correct format in Literal.getText()
This commit is contained in:
parent
2754bfef54
commit
83fcbaa633
|
@ -60,7 +60,7 @@ Literal.prototype.setText = function(text) {
|
|||
*/
|
||||
Literal.prototype.getText = function() {
|
||||
// decode UTF8
|
||||
var text = util.decode_utf8(util.Uint8Array2str(this.data));
|
||||
var text = this.format === 'utf8' ? util.decode_utf8(util.Uint8Array2str(this.data)) : util.Uint8Array2str(this.data);
|
||||
// normalize EOL to \n
|
||||
return text.replace(/\r\n/g, '\n');
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user