Module common to String objects.
Evaluates the current String as JavaScript.
# File lib/origami/javascript.rb, line 660 def eval_js self.pdf.eval_js(self.value) end
Convert String object to a PDFDocEncoding encoded Ruby string.
# File lib/origami/string.rb, line 165 def to_pdfdoc infer_encoding self.encoding.to_pdfdoc(self.value) end
Convert String object to an UTF16-BE encoded Ruby string.
# File lib/origami/string.rb, line 157 def to_utf16be infer_encoding self.encoding.to_utf16be(self.value) end
Convert String object to an UTF8 encoded Ruby string.
# File lib/origami/string.rb, line 139 def to_utf8 infer_encoding if RUBY_VERSION < '1.9' require 'iconv' i = Iconv.new("UTF-8", "UTF-16") utf8str = i.iconv(self.encoding.to_utf16be(self.value)) i.close else utf8str = self.encoding.to_utf16be(self.value).encode("utf-8", "utf-16") end utf8str end
Generated with the Darkfish Rdoc Generator 2.