From: Karel Zak Date: Wed, 10 Jun 2026 11:06:26 +0000 (+0200) Subject: asciidoctor: fix encoding error for non-ASCII translations X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d826c15252d3c6b5041d88839bbe6ae4bcf2bd18;p=thirdparty%2Futil-linux.git asciidoctor: fix encoding error for non-ASCII translations File.read without an explicit encoding uses Ruby's default external encoding, which depends on the system locale. On systems where it resolves to US-ASCII (e.g. some Debian configurations), reading translated man page files with non-ASCII content (such as Arabic) fails with "source is either binary or contains invalid Unicode data". Specify encoding: 'UTF-8' explicitly so the string is correctly tagged regardless of locale. Fixes: https://github.com/util-linux/util-linux/issues/4409 Signed-off-by: Karel Zak --- diff --git a/tools/asciidoctor-includetracker.rb b/tools/asciidoctor-includetracker.rb index bcf9ce030..42ee6da6a 100644 --- a/tools/asciidoctor-includetracker.rb +++ b/tools/asciidoctor-includetracker.rb @@ -17,7 +17,7 @@ module IncludeTracker docdir = doc.attributes["docdir"] path = target file = File.expand_path path, docdir - data = File.read file + data = File.read file, encoding: 'UTF-8' reader.push_include data, file, path, 1, attributes doc.attributes["include_dependencies"] << file reader