1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Fix a problem with SQLITE_OS_WINRT builds.

FossilOrigin-Name: baf43e8c7da6aacce874ec30d0c9e1dcb44c5ed9de2214099d42fbbd335d2e93
This commit is contained in:
dan
2024-12-02 20:48:17 +00:00
parent a180131454
commit 9d592359fe
5 changed files with 35 additions and 9 deletions

View File

@@ -389,7 +389,11 @@ static char *quota_utf8_to_mbcs(const char *zUtf8){
zTmpWide = (LPWSTR)sqlite3_malloc( (nWide+1)*sizeof(zTmpWide[0]) );
if( zTmpWide==0 ) return 0;
MultiByteToWideChar(CP_UTF8, 0, zUtf8, -1, zTmpWide, nWide);
#ifdef SQLITE_OS_WINRT
codepage = CP_ACP;
#else
codepage = AreFileApisANSI() ? CP_ACP : CP_OEMCP;
#endif
nMbcs = WideCharToMultiByte(codepage, 0, zTmpWide, nWide, 0, 0, 0, 0);
zMbcs = nMbcs ? (char*)sqlite3_malloc( nMbcs+1 ) : 0;
if( zMbcs ){