From 7b20972c27245052c619556e311f1dc7eee981af Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 9 Jun 2022 00:03:02 -0400 Subject: [PATCH] Use String.fromCharCode() to load Chinese characters in strToDate() test Follow-up to dc045250a6 --- chrome/content/zotero/xpcom/utilities | 2 +- test/tests/dateTest.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/utilities b/chrome/content/zotero/xpcom/utilities index e4a8d2695c..7ecd907641 160000 --- a/chrome/content/zotero/xpcom/utilities +++ b/chrome/content/zotero/xpcom/utilities @@ -1 +1 @@ -Subproject commit e4a8d2695c34ab7977fcf2a73720546c1c43560c +Subproject commit 7ecd907641292bc694f6d775e4d0ab933f157d68 diff --git a/test/tests/dateTest.js b/test/tests/dateTest.js index 6dcf84d2b2..2147e090c2 100644 --- a/test/tests/dateTest.js +++ b/test/tests/dateTest.js @@ -199,7 +199,9 @@ describe("Zotero.Date", function() { it("should parse Chinese month", function () { Zotero.locale = 'zh-CN'; Zotero.Date.init(); - var o = Zotero.Date.strToDate("四月 26, 2010"); + var o = Zotero.Date.strToDate( + String.fromCharCode(0x56DB) + String.fromCharCode(0x6708) + " 26, 2010" + ); assert.equal(o.month, 3); assert.equal(o.day, 26); assert.equal(o.year, 2010);