From 03443818f0af5aefa76f92cebf72816c30214919 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Wed, 25 Jun 2014 09:36:55 -0700 Subject: [PATCH] Pass UTF-8 paths to hunspell now that it supports them --- src/spellchecker_hunspell.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/spellchecker_hunspell.cpp b/src/spellchecker_hunspell.cpp index a294a51ac..ddb6c4339 100644 --- a/src/spellchecker_hunspell.cpp +++ b/src/spellchecker_hunspell.cpp @@ -196,7 +196,12 @@ void HunspellSpellChecker::OnLanguageChanged() { LOG_I("dictionary/file") << dic; - hunspell = agi::make_unique(agi::fs::ShortName(aff).c_str(), agi::fs::ShortName(dic).c_str()); +#ifdef _WIN32 + // The prefix makes hunspell assume the paths are UTF-8 and use _wfopen + hunspell = agi::make_unique(("\\\\?\\" + aff.string()).c_str(), ("\\\\?\\" + dic.string()).c_str()); +#else + hunspell = agi::make_unique(aff.string().c_str(), dic.string().c_str()); +#endif if (!hunspell) return; conv = agi::make_unique("utf-8", hunspell->get_dic_encoding());