Skip to content
Browse files

fixed dec method

  • Loading branch information...
1 parent d4b7bb9 commit fffa9142e71699ae7df6d7cdadcdd4ff27efdc0e @eicca committed
Showing with 4 additions and 2 deletions.
  1. BIN .DS_Store
  2. +2 −1 .gitignore
  3. +2 −1 lib/rtf-templater/generator.rb
  4. BIN showcase/.DS_Store
View
BIN .DS_Store
Binary file not shown.
View
3 .gitignore
@@ -15,4 +15,5 @@ spec/reports
test/tmp
test/version_tmp
tmp
-config/environment.rb
+config/environment.rb
+DS_Store
View
3 lib/rtf-templater/generator.rb
@@ -2,7 +2,8 @@ module RtfTemplater
module Generator
def dec string
- string.unpack('U*').map { |n| n < 128 ? n.chr : n < 256 ? "\\'#{n.to_s(16)}" : "\\u#{n}\\'3f" }.join
+ out = string.to_s
+ out.unpack('U*').map { |n| n < 128 ? n.chr : n < 256 ? "\\'#{n.to_s(16)}" : "\\u#{n}\\'3f" }.join
end
def render_rtf content
View
BIN showcase/.DS_Store
Binary file not shown.

0 comments on commit fffa914

Please sign in to comment.
Something went wrong with that request. Please try again.