--- nono/wx/wxapp.cpp 2026/04/29 17:05:44 1.1.1.19 +++ nono/wx/wxapp.cpp 2026/04/29 17:05:53 1.1.1.21 @@ -41,6 +41,8 @@ class WXApp : public wxApp std::unique_ptr pHostInfo {}; }; +static std::string utf8_to_sjis(const std::string&); + // IMPLEMENT_APP() は闇マクロすぎて clang のちからには耐えられない PRAGMA_PUSH_WARNINGS IMPLEMENT_APP(WXApp) @@ -63,7 +65,7 @@ WXApp::OnRun() { int rv; - rv = gMainApp.Init1(false, argc, argv); + rv = gMainApp.Init1(argc, argv, utf8_to_sjis); if (rv != MainApp::PASS) { return rv; } @@ -322,8 +324,8 @@ WXApp::ShowMonitorsName() } // 一覧を表示 - std::string msg = MonitorManager::MakeListString(list); - printf("%s", msg.c_str()); + std::vector names = gMonitorManager->MakeListString(list); + MainApp::ShowHelpList(stdout, names); } // モニタ名 name を検索し、一つに確定すればその id を返す。 @@ -449,3 +451,21 @@ WXApp::FindAvailable(const std::vector wxString + wxString wstr(utf8str.c_str(), wxConvUTF8); + + // wxString -> Shift_JIS + wxCharBuffer sjisbuf = wstr.mb_str(conv); + + return std::string(sjisbuf.data()); +}