twl-generator 1.4.11 → 1.4.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "twl-generator",
3
- "version": "1.4.11",
3
+ "version": "1.4.13",
4
4
  "description": "Generate term-to-article lists from unfoldingWord en_tw archive for Bible books. Works in both Node.js (CLI) and React.js (browser) environments.",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -51,7 +51,7 @@
51
51
  "csv-stringify": "^6.5.0",
52
52
  "en-inflectors": "^1.0.12",
53
53
  "jszip": "^3.10.1",
54
- "tsv-quote-converters": "^1.1.14",
54
+ "tsv-quote-converters": "^1.1.18",
55
55
  "usfm-alignment-remover": "^0.1.6"
56
56
  },
57
57
  "peerDependencies": {
@@ -17,8 +17,14 @@ function decodeBase64(base64String) {
17
17
  if (isNode) {
18
18
  return Buffer.from(base64String, 'base64').toString('utf-8');
19
19
  }
20
- // Browser implementation
21
- return atob(base64String);
20
+ // Browser implementation - properly handle UTF-8 characters (e.g., smart quotes)
21
+ const binaryString = atob(base64String);
22
+ const bytes = new Uint8Array(binaryString.length);
23
+ for (let i = 0; i < binaryString.length; i++) {
24
+ bytes[i] = binaryString.charCodeAt(i);
25
+ }
26
+ const decoder = new TextDecoder('utf-8');
27
+ return decoder.decode(bytes);
22
28
  }
23
29
 
24
30
  // Note: This version doesn't use usfm-js to avoid external dependencies