Skip to content

Commit

Permalink
Fix regression of garbled menubar in Traditional Chinese menu
Browse files Browse the repository at this point in the history
  • Loading branch information
maron2000 committed Dec 23, 2024
1 parent 6a958f9 commit 1023ced
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/misc/messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,9 @@ void LoadMessageFile(const char * fname) {
std::string msg = "The specified language file uses code page " + std::to_string(c) + ". Do you want to change to this code page accordingly?";
if(c != dos.loaded_codepage && (control->opt_langcp || uselangcp || !CHCP_changed || CheckDBCSCP(c) || !loadlang || (loadlang && systemmessagebox("DOSBox-X language file", msg.c_str(), "yesno", "question", 1)))) {
loadlangcp = true;
if(c == 950 && dos.loaded_codepage == 951) c = 951; // zh_tw defaults to CP950, but CP951 is acceptable as well so keep it
if(c == 951 && dos.loaded_codepage == 950) c = 950; // And vice versa for lang files requiring CP951
msgcodepage = c;
if(c == 950 && dos.loaded_codepage == 951) msgcodepage = 951; // zh_tw defaults to CP950, but CP951 is acceptable as well so keep it
else if(c == 951 && dos.loaded_codepage == 950) msgcodepage = 950; // And vice versa for lang files requiring CP951
else msgcodepage = c;
dos.loaded_codepage = c;
if (c == 950 && !chinasea) makestdcp950table();
if (c == 951 && chinasea) makeseacp951table();
Expand Down
4 changes: 3 additions & 1 deletion src/shell/shell_cmds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ extern bool systemmessagebox(char const * aTitle, char const * aMessage, char co
extern void Load_Language(std::string name), GetExpandedPath(std::string &path);
extern void MAPPER_AutoType(std::vector<std::string> &sequence, const uint32_t wait_ms, const uint32_t pace_ms, bool choice);
extern void DOS_SetCountry(uint16_t countryNo), DOSV_FillScreen(void);
void clearFontCache(void);
std::string GetDOSBoxXPath(bool withexe=false);
FILE *testLoadLangFile(const char *fname);
Bitu DOS_ChangeCodepage(int32_t codepage, const char* codepagefile);
Expand Down Expand Up @@ -4561,11 +4562,12 @@ int toSetCodePage(DOS_Shell *shell, int newCP, int opt) {
#endif
DOSBox_SetSysMenu();
}
if (isDBCSCP()) {
if(isDBCSCP()) {
ShutFontHandle();
InitFontHandle();
JFONT_Init();
SetupDBCSTable();
clearFontCache();
}
if (finish_prepare) runRescan("-A -Q");
#if defined(USE_TTF)
Expand Down

0 comments on commit 1023ced

Please sign in to comment.