lib/markout/formatters/pdf/pdf.rb in karmi-markout-0.1.0 vs lib/markout/formatters/pdf/pdf.rb in karmi-markout-0.1.1
- old
+ new
@@ -1,5 +1,7 @@
+$KCODE = 'UTF-8'
+
require 'tempfile'
require File.join(File.dirname(__FILE__), '..', 'html', 'html.rb')
# Depends on HTMLDOC utility (http://www.easysw.com/htmldoc/)
module Markout
@@ -17,10 +19,11 @@
private
def tempfile
tempfile = Tempfile.new(File.basename(@document.path) + '.html')
- tempfile << Markout::Html.new(@document).export
+ content = Markout::Html.new(@document).export
+ tempfile << content.gsub(/[^\x00-\x7F]/) { |ch| "&##{ch.unpack("U")[0]};" } # From the Textmate Markdown bundle
end
end
end