/ Check-in [f4411f0c]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Expose the MBCS->UTF8 convert routine in the Win32 backend. (CVS 5917)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:f4411f0c8075adc8a37002ac7ad958ff3158c0c0
User & Date: drh 2008-11-18 19:18:52
Context
2008-11-18
23:03
Add support for SQLITE_NO_SYNC for OS/2, too. (CVS 5918) check-in: 2990b5b8 user: pweilbacher tags: trunk
19:18
Expose the MBCS->UTF8 convert routine in the Win32 backend. (CVS 5917) check-in: f4411f0c user: drh tags: trunk
19:18
Application-defined page cache documentation updates. (CVS 5916) check-in: db0f1203 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_win.c.

     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   ******************************************************************************
    12     12   **
    13     13   ** This file contains code that is specific to windows.
    14     14   **
    15         -** $Id: os_win.c,v 1.138 2008/11/13 18:20:43 shane Exp $
           15  +** $Id: os_win.c,v 1.139 2008/11/18 19:18:52 drh Exp $
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   #if SQLITE_OS_WIN               /* This file is used for windows only */
    19     19   
    20     20   
    21     21   /*
    22     22   ** A Note About Memory Allocation:
................................................................................
   248    248     return zFilename;
   249    249   }
   250    250   
   251    251   /*
   252    252   ** Convert multibyte character string to UTF-8.  Space to hold the
   253    253   ** returned string is obtained from malloc().
   254    254   */
   255         -static char *mbcsToUtf8(const char *zFilename){
          255  +char *sqlite3_win32_mbcs_to_utf8(const char *zFilename){
   256    256     char *zFilenameUtf8;
   257    257     WCHAR *zTmpWide;
   258    258   
   259    259     zTmpWide = mbcsToUnicode(zFilename);
   260    260     if( zTmpWide==0 ){
   261    261       return 0;
   262    262     }
................................................................................
  1136   1136   ** it's important to not reference them for WINCE builds.
  1137   1137   */
  1138   1138   #if SQLITE_OS_WINCE==0
  1139   1139     }else{
  1140   1140       char *zUtf8;
  1141   1141       char zMbcsPath[MAX_PATH];
  1142   1142       GetTempPathA(MAX_PATH-30, zMbcsPath);
  1143         -    zUtf8 = mbcsToUtf8(zMbcsPath);
         1143  +    zUtf8 = sqlite3_win32_mbcs_to_utf8(zMbcsPath);
  1144   1144       if( zUtf8 ){
  1145   1145         sqlite3_snprintf(MAX_PATH-30, zTempPath, "%s", zUtf8);
  1146   1146         free(zUtf8);
  1147   1147       }else{
  1148   1148         return SQLITE_NOMEM;
  1149   1149       }
  1150   1150   #endif
................................................................................
  1477   1477       zTemp = malloc( nByte*sizeof(zTemp[0]) );
  1478   1478       if( zTemp==0 ){
  1479   1479         free(zConverted);
  1480   1480         return SQLITE_NOMEM;
  1481   1481       }
  1482   1482       GetFullPathNameA((char*)zConverted, nByte, zTemp, 0);
  1483   1483       free(zConverted);
  1484         -    zOut = mbcsToUtf8(zTemp);
         1484  +    zOut = sqlite3_win32_mbcs_to_utf8(zTemp);
  1485   1485       free(zTemp);
  1486   1486   #endif
  1487   1487     }
  1488   1488     if( zOut ){
  1489   1489       sqlite3_snprintf(pVfs->mxPathname, zFull, "%s", zOut);
  1490   1490       free(zOut);
  1491   1491       return SQLITE_OK;