catch a invalid_utf8_exception when displaying a save-corrupt message,
...fixing bug #12771 , or more like woring around another issue concerning invalid UTF getting in the warning message in the first place
This commit is contained in:
parent
49f3368e60
commit
3ab289386f
1 changed files with 9 additions and 3 deletions
12
src/game.cpp
12
src/game.cpp
|
@ -890,9 +890,15 @@ bool game_controller::load_game()
|
|||
std::string error_log;
|
||||
read_save_file(game,cfg,&error_log);
|
||||
if(!error_log.empty()) {
|
||||
gui::show_error_message(disp(),
|
||||
_("Warning: The file you have tried to load is corrupt. Loading anyway.\n") +
|
||||
error_log);
|
||||
try {
|
||||
gui::show_error_message(disp(),
|
||||
_("Warning: The file you have tried to load is corrupt. Loading anyway.\n") +
|
||||
error_log);
|
||||
} catch (utils::invalid_utf8_exception&) {
|
||||
gui::show_error_message(disp(),
|
||||
_("Warning: The file you have tried to load is corrupt. Loading anyway.\n") +
|
||||
std::string("(UTF-8 ERROR)"));
|
||||
}
|
||||
}
|
||||
|
||||
cache_.clear_defines();
|
||||
|
|
Loading…
Add table
Reference in a new issue