Method: HexaPDF::Utils::PDFDocEncoding.convert_to_utf8

Defined in:
lib/hexapdf/utils/pdf_doc_encoding.rb

.convert_to_utf8(str) ⇒ Object

Converts the given string to UTF-8, assuming it contains bytes in PDFDocEncoding.



89
90
91
# File 'lib/hexapdf/utils/pdf_doc_encoding.rb', line 89

def self.convert_to_utf8(str)
  str.each_byte.with_object(+'') {|byte, result| result << CHARACTER_MAP[byte] }
end