Module: RtfTemplater::Generator
- Defined in:
- lib/rtf-templater/generator.rb
Instance Method Summary collapse
Instance Method Details
#dec(string) ⇒ Object
4 5 6 7 |
# File 'lib/rtf-templater/generator.rb', line 4 def dec string out = string.to_s out.unpack('U*').map { |n| n < 128 ? n.chr : n < 256 ? "\\'#{n.to_s(16)}" : "\\u#{n}\\'3f" }.join end |