aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/js/jsbip39.js11
-rw-r--r--src/js/unorm.js3
2 files changed, 5 insertions, 9 deletions
diff --git a/src/js/jsbip39.js b/src/js/jsbip39.js
index 025f625..95a2a0e 100644
--- a/src/js/jsbip39.js
+++ b/src/js/jsbip39.js
@@ -149,21 +149,14 @@ var Mnemonic = function(language) {
149 // Set space correctly depending on the language 149 // Set space correctly depending on the language
150 // see https://github.com/bitcoin/bips/blob/master/bip-0039/bip-0039-wordlists.md#japanese 150 // see https://github.com/bitcoin/bips/blob/master/bip-0039/bip-0039-wordlists.md#japanese
151 var space = " "; 151 var space = " ";
152 if (language == "japanese") { 152 if (language == "japanese" || language == "korean") {
153 space = "\u3000"; // ideographic space 153 space = "\u3000"; // ideographic space
154 } 154 }
155 return words.join(space); 155 return words.join(space);
156 } 156 }
157 157
158 self.normalizeString = function(str) { 158 self.normalizeString = function(str) {
159 if (typeof str.normalize == "function") { 159 return str.normalize("NFKD");
160 return str.normalize("NFKD");
161 }
162 else {
163 // TODO decide how to handle this in the future.
164 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize
165 return str;
166 }
167 } 160 }
168 161
169 function byteArrayToWordArray(data) { 162 function byteArrayToWordArray(data) {
diff --git a/src/js/unorm.js b/src/js/unorm.js
index 92d3699..d4292f3 100644
--- a/src/js/unorm.js
+++ b/src/js/unorm.js
@@ -1,3 +1,6 @@
1// Polyfill for NFKD normalization
2// See https://github.com/walling/unorm
3
1(function (root) { 4(function (root) {
2 "use strict"; 5 "use strict";
3 6