diff options
author | sfan5 <sfan5@live.de> | 2021-01-29 14:03:27 +0100 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2021-02-02 20:46:08 +0100 |
commit | c834d2ab25694ef2d67dc24f85f304269d202c8e (patch) | |
tree | c62a57d0cdbca950b9c7cb1a58666b6b77760bc2 /src/chat.cpp | |
parent | 5e392cf34f8e062dd0533619921223656e32598a (diff) | |
download | minetest-c834d2ab25694ef2d67dc24f85f304269d202c8e.tar.gz minetest-c834d2ab25694ef2d67dc24f85f304269d202c8e.tar.bz2 minetest-c834d2ab25694ef2d67dc24f85f304269d202c8e.zip |
Drop wide/narrow conversion functions
The only valid usecase for these is interfacing with OS APIs
that want a locale/OS-specific multibyte encoding.
But they weren't used for that anywhere, instead UTF-8 is pretty
much assumed when it comes to that.
Since these are only a potential source of bugs and do not fulfil
their purpose at all, drop them entirely.
Diffstat (limited to 'src/chat.cpp')
-rw-r--r-- | src/chat.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/chat.cpp b/src/chat.cpp index 2f65e68b3..c9317a079 100644 --- a/src/chat.cpp +++ b/src/chat.cpp @@ -485,8 +485,8 @@ void ChatPrompt::nickCompletion(const std::list<std::string>& names, bool backwa // find all names that start with the selected prefix std::vector<std::wstring> completions; for (const std::string &name : names) { - if (str_starts_with(narrow_to_wide(name), prefix, true)) { - std::wstring completion = narrow_to_wide(name); + std::wstring completion = utf8_to_wide(name); + if (str_starts_with(completion, prefix, true)) { if (prefix_start == 0) completion += L": "; completions.push_back(completion); |