Skip to content

Commit

Permalink
Use String#bytesize instead of String#size
Browse files Browse the repository at this point in the history
I'm fairly sure this should be based on byte count
  • Loading branch information
yob committed Jul 14, 2019
1 parent 90faae6 commit ea452c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/pdf/reader/cmap.rb
Expand Up @@ -98,7 +98,7 @@ def build_parser(instructions)

def str_to_int(str)
return nil if str.nil? || str.size == 0
unpacked_string = if str.size == 1 # UTF-8
unpacked_string = if str.bytesize == 1 # UTF-8
str.unpack("C*")
else # UTF-16
str.unpack("n*")
Expand Down

0 comments on commit ea452c8

Please sign in to comment.