From 483d384d4ab79595129a41728b7cdd59cf99911d Mon Sep 17 00:00:00 2001 From: Fares Bessrour Date: Thu, 12 Oct 2017 14:15:36 -0400 Subject: [PATCH] Bug with Special Characters I found a bug where the Script stopped when it found a # (Specific case of special characters). Using the encodeURIComponent instead of encodeURI solves this issue. --- translate-json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translate-json b/translate-json index 09d40e0..963cd78 100644 --- a/translate-json +++ b/translate-json @@ -34,7 +34,7 @@ if (process.argv.length >= 5) { //Translates individual string to language code return agent('GET', apiUrl({ - value: encodeURI(value), + value: encodeURIComponent(value), languageKey, apiKey })).then(transformResponse).then((text) => { @@ -66,4 +66,4 @@ if (process.argv.length >= 5) { } else { console.error('You must provide an input json file and a comma-separated list of destination language codes.'); -} \ No newline at end of file +}