From 0302d86053729f2593ba7c9be3b3e72360b34c74 Mon Sep 17 00:00:00 2001 From: "R. Kent James" Date: Mon, 2 Sep 2024 13:31:06 -0700 Subject: [PATCH] Force Pandoc to return UTF8 --- _ruby_libs/text_rendering.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/_ruby_libs/text_rendering.rb b/_ruby_libs/text_rendering.rb index 997092ae..9642f758 100644 --- a/_ruby_libs/text_rendering.rb +++ b/_ruby_libs/text_rendering.rb @@ -7,7 +7,8 @@ # Converts RST to Markdown def rst_to_md(rst) begin - return PandocRuby.convert(rst, :from => :rst, :to => :markdown) + # For some reason, Pandoc is converting UTF-8 into ASCII which then kills kramdown + return PandocRuby.convert(rst, :from => :rst, :to => :markdown).force_encoding(Encoding::UTF_8) rescue Exception => e return "Could not convert RST to MD: "+e.to_s end