Skip to content

Commit

Permalink
Fix node.js handling of multi-byte UTF8 characters (#6761)
Browse files Browse the repository at this point in the history
* Fix node.js handling of multi-byte UTF8 characters

Fixes issue #6280, where the node.js API doesn't properly handle
multi-byte UTF8 characters received from the driver.

* Specify encoding in toString
  • Loading branch information
JohnChen0 authored and jleyba committed May 14, 2019
1 parent 94af952 commit 2870009
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion javascript/node/selenium-webdriver/http/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ function sendRequest(options, onOk, onError, opt_data, opt_proxy, opt_retries) {
var resp = new httpLib.Response(
/** @type {number} */(response.statusCode),
/** @type {!Object<string>} */(response.headers),
body.join('').replace(/\0/g, ''));
Buffer.concat(body).toString('utf8').replace(/\0/g, ''));
onOk(resp);
});
});
Expand Down

0 comments on commit 2870009

Please sign in to comment.