Skip to content

Commit 8a5ea55

Browse files
Uzlopakanonrig
authored andcommitted
add test cases for utf16 characeters
1 parent 19336b7 commit 8a5ea55

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

test/stringify.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,13 @@ test("should omit non-object inputs", () => {
5858
assert.deepEqual(qs.stringify("hello" as any), "");
5959
});
6060

61+
test("should handle utf16 characters", () => {
62+
assert.deepEqual(qs.stringify({ utf16: "ܩ" }), "utf16=%DC%A9");
63+
assert.deepEqual(qs.stringify({ utf16: "睷" }), "utf16=%E7%9D%B7");
64+
assert.deepEqual(qs.stringify({ utf16: "aܩ" }), "utf16=a%DC%A9");
65+
assert.deepEqual(qs.stringify({ utf16: "a睷" }), "utf16=a%E7%9D%B7");
66+
});
67+
6168
test("should handle multi-byte characters", () => {
6269
assert.deepEqual(qs.stringify({ multiByte: "𝌆" }), "multiByte=%F0%9D%8C%86");
6370
});

0 commit comments

Comments
 (0)