Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/pdfbeads.rb,
lib/imageinspector.rb

Instance Method Summary collapse

Instance Method Details

#ordObject



76
77
78
79
80
81
82
# File 'lib/pdfbeads.rb', line 76

def ord()
  begin
    return Iconv.iconv( 'utf-16be','utf-8',self ).first.unpack('n')[0]
  rescue
    return 0x3F # Question mark
  end
end

#to_binaryObject



58
59
60
61
# File 'lib/pdfbeads.rb', line 58

def to_binary()
  force_encoding 'ASCII-8BIT' if respond_to? :force_encoding
  return self
end

#to_textObject



67
68
69
70
# File 'lib/pdfbeads.rb', line 67

def to_text()
  force_encoding 'UTF-8' if respond_to? :force_encoding
  return self
end