mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-09-22 23:18:01 +03:00
Merge pull request #289 from kichikuou/dap-output
debugger_dap: Fix garbled characters in output events on Windows
This commit is contained in:
@@ -1087,6 +1087,13 @@ void dbg_dap_log(const char *log, const char *fmt, va_list ap)
|
||||
size_t len = max(1024, strlen(fmt) * 2);
|
||||
char *buf = xmalloc(len);
|
||||
vsnprintf(buf, len, fmt, ap);
|
||||
#ifdef _WIN32
|
||||
// Since the callers use display_sjis*(), buf is in Shift_JIS on Windows.
|
||||
// Convert to UTF-8 for DAP.
|
||||
char *utf8 = sjis2utf(buf, 0);
|
||||
free(buf);
|
||||
buf = utf8;
|
||||
#endif
|
||||
emit_output_event(log, buf);
|
||||
free(buf);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user