rewrite text encoding to handle non-English properly

This commit is contained in:
Martin Michelsen
2023-10-24 12:02:22 -07:00
parent 6b97c628ef
commit 0c53a0dc41
65 changed files with 2483 additions and 2731 deletions
+1 -2
View File
@@ -295,7 +295,6 @@ vector<shared_ptr<Client>> Server::get_clients_by_identifier(const string& ident
serial_number_hex = stoul(ident, nullptr, 16);
} catch (const invalid_argument&) {
}
u16string u16name = decode_sjis(ident);
// TODO: It's kind of not great that we do a linear search here, but this is
// only used in the shell, so it should be pretty rare.
@@ -316,7 +315,7 @@ vector<shared_ptr<Client>> Server::get_clients_by_identifier(const string& ident
}
auto p = c->game_data.player(false, false);
if (p && p->disp.name == u16name) {
if (p && p->disp.name.eq(ident, p->inventory.language)) {
results.emplace_back(std::move(c));
continue;
}