Ruby-RTF icon indicating copy to clipboard operation
Ruby-RTF copied to clipboard

Parsing rtf file with simple text result junk in output

Open ShockwaveNN opened this issue 4 years ago • 0 comments

Try to parse attached file test.zip

LibreOffice and all other known to me editors correctly opens it image

But parsing it with ruby-rtf result are:

require_relative 'lib/ruby-rtf'

rtf = RubyRTF::Parser.new.parse(File.open('/home/lobashov/temp/test.rtf').read)
rtf.sections.each do |sec|
  puts sec[:text]
end

Outpus (ignoring warnings about unknown control):

‰đėĔ

ĖāĠĖ

ĄāĔā




„āĕĖ


 

Tested on ruby-rtf v0.0.5 with ruby 2.7

ShockwaveNN avatar Aug 13 '20 08:08 ShockwaveNN