mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 09:38:06 +02:00
[Editor] Correctly save a non-ascii alt text
This commit is contained in:
parent
cb737512de
commit
c3065629ca
4 changed files with 67 additions and 27 deletions
|
@ -613,6 +613,10 @@ function getNewAnnotationsMap(annotationStorage) {
|
|||
return newAnnotationsByPage.size > 0 ? newAnnotationsByPage : null;
|
||||
}
|
||||
|
||||
function stringToAsciiOrUTF16BE(str) {
|
||||
return isAscii(str) ? str : stringToUTF16String(str, /* bigEndian = */ true);
|
||||
}
|
||||
|
||||
function isAscii(str) {
|
||||
return /^[\x00-\x7F]*$/.test(str);
|
||||
}
|
||||
|
@ -699,6 +703,7 @@ export {
|
|||
readUint16,
|
||||
readUint32,
|
||||
recoverJsURL,
|
||||
stringToAsciiOrUTF16BE,
|
||||
stringToUTF16HexString,
|
||||
stringToUTF16String,
|
||||
toRomanNumerals,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue