mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-04-22 07:30:50 +00:00
Add proper unicode support to Windows error reporting
This commit is contained in:
parent
66d916a34a
commit
94dbb9601e
1 changed files with 9 additions and 1 deletions
|
@ -1697,7 +1697,7 @@ fluid_long_long_t fluid_file_tell(FILE* f)
|
|||
// not thread-safe!
|
||||
char* fluid_get_windows_error(void)
|
||||
{
|
||||
static char err[1024];
|
||||
static TCHAR err[1024];
|
||||
|
||||
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
|
||||
NULL,
|
||||
|
@ -1706,6 +1706,14 @@ char* fluid_get_windows_error(void)
|
|||
err,
|
||||
sizeof(err)/sizeof(err[0]),
|
||||
NULL);
|
||||
|
||||
#ifdef _UNICODE
|
||||
static char ascii_err[sizeof(err)];
|
||||
|
||||
WideCharToMultiByte(CP_UTF8, 0, err, -1, ascii_err, sizeof(ascii_err)/sizeof(ascii_err[0]), 0, 0);
|
||||
return ascii_err;
|
||||
#else
|
||||
return err;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue