From 33a6f6db56055d58ee2d24262c4a9abdccdb9679 Mon Sep 17 00:00:00 2001 From: Admin Date: Mon, 28 Nov 2022 01:21:47 -0500 Subject: Replace invalid utf-8 characters in html2md --- html2md.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html2md.rb b/html2md.rb index 0ba7f55..404fbde 100755 --- a/html2md.rb +++ b/html2md.rb @@ -16,7 +16,7 @@ end filename = ARGV[0] file_no_ext = File.basename(filename, File.extname(filename)) -content = File.read(filename) +content = File.read(filename).encode('UTF-8', invalid: :replace, undef: :replace) doc = Nokogiri.parse(content) title = doc.title -- cgit v1.2.3