mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
Move the isAscii
helper function into the worker-thread
Given that this helper function is only used on the worker-thread, there's no reason to duplicate it in both of the `pdf.js` and `pdf.worker.js` files.
This commit is contained in:
parent
2eaa708e3a
commit
e5859e145d
5 changed files with 17 additions and 17 deletions
|
@ -18,6 +18,7 @@ import {
|
|||
encodeToXmlString,
|
||||
escapePDFName,
|
||||
getInheritableProperty,
|
||||
isAscii,
|
||||
isWhiteSpace,
|
||||
log2,
|
||||
parseXFAPath,
|
||||
|
@ -335,6 +336,16 @@ describe("core_utils", function () {
|
|||
});
|
||||
});
|
||||
|
||||
describe("isAscii", function () {
|
||||
it("handles ascii/non-ascii strings", function () {
|
||||
expect(isAscii("hello world")).toEqual(true);
|
||||
expect(isAscii("こんにちは世界の")).toEqual(false);
|
||||
expect(isAscii("hello world in Japanese is こんにちは世界の")).toEqual(
|
||||
false
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("stringToUTF16String", function () {
|
||||
it("should encode a string in UTF16", function () {
|
||||
expect(stringToUTF16String("hello world")).toEqual(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue