Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove hard-coded utf8 encoding

  • Loading branch information...
commit b8be8163badb857f3ea1f8066a7b38a248f214ed 1 parent 2db7b52
@wdavidw authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/csv.js
View
4 lib/csv.js
@@ -454,12 +454,12 @@ module.exports = function(){
line = ''+line;
}
if(state.buffer){
- if(state.bufferPosition + Buffer.byteLength(line,'utf8') > csv.readOptions.bufferSize){
+ if(state.bufferPosition + Buffer.byteLength(line, csv.writeOptions.encoding) > csv.readOptions.bufferSize){
csv.writeStream.write(state.buffer.slice(0, state.bufferPosition));
state.buffer = new Buffer(csv.readOptions.bufferSize);
state.bufferPosition = 0;
}
- state.bufferPosition += state.buffer.write(line, state.bufferPosition,'utf8');
+ state.bufferPosition += state.buffer.write(line, state.bufferPosition, csv.writeOptions.encoding);
}
if(!preserve){
state.countWriten++;
Please sign in to comment.
Something went wrong with that request. Please try again.