Skip to content

Commit 42f2bca

Browse files
committed
Removing need for CMap operations for null strings
1 parent cb7321d commit 42f2bca

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/PDFonts.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ end
114114
get_encoded_string(s::CosString, fum::Void) = CDTextString(s)
115115

116116
function get_encoded_string(s::CosString, fum::FontUnicodeMapping)
117+
v = Vector{UInt8}(s)
118+
length(v) == 0 && return ""
117119
fum.hasCMap && return get_encoded_string(s, fum.cmap)
118120
carr = NativeEncodingToUnicode(Vector{UInt8}(s), fum.encoding)
119121
return String(carr)

0 commit comments

Comments
 (0)