commit 4420b5645a22fb5785db4a953f121361709c7df5
parent 6c0838653ed08a9dc82a5f4f0b8031e85e5c1d50
Author: Frederic Cambus <fred@statdns.com>
Date: Tue, 28 Aug 2018 08:46:21 +0200
Enforce UTF-8 character encoding
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/bin/motyl b/bin/motyl
@@ -6,7 +6,7 @@
# https://github.com/fcambus/motyl #
# #
# Created: 2016-02-16 #
-# Last Updated: 2018-04-28 #
+# Last Updated: 2018-08-28 #
# #
# Motyl is released under the BSD 2-Clause license. #
# See LICENSE file for details. #
@@ -18,6 +18,10 @@ require 'kramdown'
require 'mustache'
require 'yaml'
+# Enforce UTF-8 character encoding
+Encoding.default_internal = Encoding::UTF_8
+Encoding.default_external = Encoding::UTF_8
+
# Load and process Markdown file
def markdown(path)
Kramdown::Document.new(File.read(path), smart_quotes: ['apos', 'apos', 'quot', 'quot'], syntax_highlighter: 'rouge').to_html