diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-03-16 21:16:17 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-03-21 20:25:17 +0100 |
| commit | 937185745167bbd12ebdb46ec3cf5127d26394ff (patch) | |
| tree | 70c0c5ca0c82b64557b8b496e8d4994ae1500ba8 | |
| parent | 511c089e1442ce66ec985d4e70782f9e188b1fd2 (diff) | |
Add missing UTF8 version of do_stat().
| -rw-r--r-- | src/KM_fileio.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/KM_fileio.cpp b/src/KM_fileio.cpp index 4d50722..2d3fd27 100644 --- a/src/KM_fileio.cpp +++ b/src/KM_fileio.cpp @@ -95,7 +95,13 @@ do_stat(const char* path, fstat_t* stat_info) #ifdef KM_WIN32 UINT prev = ::SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOOPENFILEERRORBOX); +#ifdef KM_WIN32_UTF8 + ByteString wb_filename; + Result_t result = utf8_to_wbstr(path, wb_filename); + if ( _wstati64((wchar_t*)wb_filename.RoData(), stat_info) == (__int64)-1 ) +#else if ( _stati64(path, stat_info) == (__int64)-1 ) +#endif result = Kumu::RESULT_FILEOPEN; ::SetErrorMode( prev ); |
