Skip to content

Commit

Permalink
fix: If encoding is passed to svn.ts it uses that rather than guessing
Browse files Browse the repository at this point in the history
fixes #483
  • Loading branch information
JohnstonCode committed Mar 15, 2019
1 parent 2b28a5a commit d7855f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/svn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export class Svn {
// Force non interactive environment
args.push("--non-interactive");

let encoding = options.encoding || "utf8";
let encoding = options.encoding || "";
delete options.encoding;

const defaults: cp.SpawnOptions = {
Expand Down Expand Up @@ -171,7 +171,7 @@ export class Svn {
// SVN with '--xml' always return 'UTF-8', and jschardet detects this encoding: 'TIS-620'
if (args.includes("--xml")) {
encoding = "utf8";
} else {
} else if (encoding === "") {
const defaultEncoding = configuration.get<string>("default.encoding");
if (defaultEncoding) {
if (!iconv.encodingExists(defaultEncoding)) {
Expand Down

0 comments on commit d7855f9

Please sign in to comment.