Checks if a string contains characters that require UTF-16BE encoding.
PDFDocEncoding can represent:
Anything outside this range requires UTF-16BE encoding.
The string to check
True if the string contains characters that cannot be represented in PDFDocEncoding
needsUnicodeEncoding('Hello') // Returns false (ASCII)needsUnicodeEncoding('Café') // Returns false (ISO Latin-1)needsUnicodeEncoding('Test • item') // Returns false (special PDF char)needsUnicodeEncoding('Hello 世界') // Returns true (needs UTF-16BE) Copy
needsUnicodeEncoding('Hello') // Returns false (ASCII)needsUnicodeEncoding('Café') // Returns false (ISO Latin-1)needsUnicodeEncoding('Test • item') // Returns false (special PDF char)needsUnicodeEncoding('Hello 世界') // Returns true (needs UTF-16BE)
Checks if a string contains characters that require UTF-16BE encoding.
PDFDocEncoding can represent:
Anything outside this range requires UTF-16BE encoding.