From acefd43a13cd0af5a492ed4f0d228d223e9589b4 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Sat, 30 Dec 2023 23:22:26 -0800 Subject: [PATCH] treat doc source as utf-8 --- docs/changelog.txt | 1 + library/lua/helpdb.lua | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/changelog.txt b/docs/changelog.txt index 0670232a5..9b6ea1e0c 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -63,6 +63,7 @@ Template for new versions: - wherever units are listed in DFHack tools, properties like "agitated" or (-trained-) are now shown ## Documentation +- UTF-8 text in tool docs is now properly displayed in-game in `gui/launcher` (assuming that it can be converted to cp-437) ## API diff --git a/library/lua/helpdb.lua b/library/lua/helpdb.lua index a4e75ff0c..85371ecc4 100644 --- a/library/lua/helpdb.lua +++ b/library/lua/helpdb.lua @@ -138,6 +138,7 @@ local function update_entry(entry, iterator, opts) local tags_found, short_help_found = false, opts.skip_short_help local in_tags, in_short_help = false, false for line in iterator do + line = dfhack.utf2df(line) if not short_help_found and first_line_is_short_help then line = line:trim() local _,_,text = line:find('^'..first_line_is_short_help..'%s*(.*)')