We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I discovered, that PDF::Core::Stream#length returns the wrong length if a multi-byte string is used, i.e:
PDF::Core::Stream#length
content = <<~XMP <?xpacket begin="\u{FEFF}" id="W5M0MpCehiHzreSzNTczkc9d"?> <?xpacket end="w"?> XMP puts "CONTENT BYTESIZE: #{content.bytesize}" stream_1 = PDF::Core::Stream.new stream_1 << content puts "STREAM LENGTH #1: #{stream_1.length} << WRONG" stream_2 = PDF::Core::Stream.new stream_2 << content.force_encoding('BINARY') puts "STREAM LENGTH #2: #{stream_2.length}"
outputs:
CONTENT BYTESIZE: 74 STREAM LENGTH #1: 72 << WRONG STREAM LENGTH #2: 74
I think this line in PDF::Core::Stream#length should use String#bytesize instead of String#length
String#bytesize
String#length
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I discovered, that
PDF::Core::Stream#length
returns the wrong length if a multi-byte string is used, i.e:outputs:
I think this line in PDF::Core::Stream#length should use
String#bytesize
instead ofString#length
The text was updated successfully, but these errors were encountered: