|
|
@ -5956,7 +5956,7 @@ extern const unsigned char sqlite3UtfTrans1[];
|
|
|
|
** invalid characters.
|
|
|
|
** invalid characters.
|
|
|
|
**
|
|
|
|
**
|
|
|
|
** * These routines accept an infinite number of different UTF8 encodings
|
|
|
|
** * These routines accept an infinite number of different UTF8 encodings
|
|
|
|
** for tqunicode values 0x80 and greater. They do not change over-length
|
|
|
|
** for unicode values 0x80 and greater. They do not change over-length
|
|
|
|
** encodings to 0xfffd as some systems recommend.
|
|
|
|
** encodings to 0xfffd as some systems recommend.
|
|
|
|
**
|
|
|
|
**
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -9466,7 +9466,7 @@ typedef struct Mem Mem;
|
|
|
|
** No other flags may be set in this case.
|
|
|
|
** No other flags may be set in this case.
|
|
|
|
**
|
|
|
|
**
|
|
|
|
** If the MEM_Str flag is set then Mem.z points at a string representation.
|
|
|
|
** If the MEM_Str flag is set then Mem.z points at a string representation.
|
|
|
|
** Usually this is encoded in the same tqunicode encoding as the main
|
|
|
|
** Usually this is encoded in the same unicode encoding as the main
|
|
|
|
** database (see below for exceptions). If the MEM_Term flag is also
|
|
|
|
** database (see below for exceptions). If the MEM_Term flag is also
|
|
|
|
** set, then the string is nul terminated. The MEM_Int and MEM_Real
|
|
|
|
** set, then the string is nul terminated. The MEM_Int and MEM_Real
|
|
|
|
** flags may coexist with the MEM_Str flag.
|
|
|
|
** flags may coexist with the MEM_Str flag.
|
|
|
@ -10100,10 +10100,10 @@ SQLITE_PRIVATE int sqlite3VdbeMemHandleBom(Mem *pMem){
|
|
|
|
#endif /* SQLITE_OMIT_UTF16 */
|
|
|
|
#endif /* SQLITE_OMIT_UTF16 */
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
** pZ is a UTF-8 encoded tqunicode string. If nByte is less than zero,
|
|
|
|
** pZ is a UTF-8 encoded unicode string. If nByte is less than zero,
|
|
|
|
** return the number of tqunicode characters in pZ up to (but not including)
|
|
|
|
** return the number of unicode characters in pZ up to (but not including)
|
|
|
|
** the first 0x00 byte. If nByte is not less than zero, return the
|
|
|
|
** the first 0x00 byte. If nByte is not less than zero, return the
|
|
|
|
** number of tqunicode characters in the first nByte of pZ (or up to
|
|
|
|
** number of unicode characters in the first nByte of pZ (or up to
|
|
|
|
** the first 0x00, whichever comes first).
|
|
|
|
** the first 0x00, whichever comes first).
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
SQLITE_PRIVATE int sqlite3Utf8CharLen(const char *zIn, int nByte){
|
|
|
|
SQLITE_PRIVATE int sqlite3Utf8CharLen(const char *zIn, int nByte){
|
|
|
@ -10142,10 +10142,10 @@ SQLITE_PRIVATE char *sqlite3Utf16to8(const void *z, int nByte){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
** pZ is a UTF-16 encoded tqunicode string. If nChar is less than zero,
|
|
|
|
** pZ is a UTF-16 encoded unicode string. If nChar is less than zero,
|
|
|
|
** return the number of bytes up to (but not including), the first pair
|
|
|
|
** return the number of bytes up to (but not including), the first pair
|
|
|
|
** of consecutive 0x00 bytes in pZ. If nChar is not less than zero,
|
|
|
|
** of consecutive 0x00 bytes in pZ. If nChar is not less than zero,
|
|
|
|
** then return the number of bytes in the first nChar tqunicode characters
|
|
|
|
** then return the number of bytes in the first nChar unicode characters
|
|
|
|
** in pZ (or up until the first pair of 0x00 bytes, whichever comes first).
|
|
|
|
** in pZ (or up until the first pair of 0x00 bytes, whichever comes first).
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
SQLITE_PRIVATE int sqlite3Utf16ByteLen(const void *zIn, int nChar){
|
|
|
|
SQLITE_PRIVATE int sqlite3Utf16ByteLen(const void *zIn, int nChar){
|
|
|
@ -16229,7 +16229,7 @@ int sqlite3_os_type = 0;
|
|
|
|
#endif /* OS_WINCE */
|
|
|
|
#endif /* OS_WINCE */
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
** Convert a UTF-8 string to microsoft tqunicode (UTF-16?).
|
|
|
|
** Convert a UTF-8 string to microsoft unicode (UTF-16?).
|
|
|
|
**
|
|
|
|
**
|
|
|
|
** Space to hold the returned string is obtained from sqliteMalloc.
|
|
|
|
** Space to hold the returned string is obtained from sqliteMalloc.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -16251,10 +16251,10 @@ static WCHAR *utf8ToUnicode(const char *zFilename){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
** Convert microsoft tqunicode to UTF-8. Space to hold the returned string is
|
|
|
|
** Convert microsoft unicode to UTF-8. Space to hold the returned string is
|
|
|
|
** obtained from sqliteMalloc().
|
|
|
|
** obtained from sqliteMalloc().
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
static char *tqunicodeToUtf8(const WCHAR *zWideFilename){
|
|
|
|
static char *unicodeToUtf8(const WCHAR *zWideFilename){
|
|
|
|
int nByte;
|
|
|
|
int nByte;
|
|
|
|
char *zFilename;
|
|
|
|
char *zFilename;
|
|
|
|
|
|
|
|
|
|
|
@ -16273,7 +16273,7 @@ static char *tqunicodeToUtf8(const WCHAR *zWideFilename){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
** Convert an ansi string to microsoft tqunicode, based on the
|
|
|
|
** Convert an ansi string to microsoft unicode, based on the
|
|
|
|
** current codepage settings for file apis.
|
|
|
|
** current codepage settings for file apis.
|
|
|
|
**
|
|
|
|
**
|
|
|
|
** Space to hold the returned string is obtained
|
|
|
|
** Space to hold the returned string is obtained
|
|
|
@ -16298,13 +16298,13 @@ static WCHAR *mbcsToUnicode(const char *zFilename){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
** Convert microsoft tqunicode to multibyte character string, based on the
|
|
|
|
** Convert microsoft unicode to multibyte character string, based on the
|
|
|
|
** user's Ansi codepage.
|
|
|
|
** user's Ansi codepage.
|
|
|
|
**
|
|
|
|
**
|
|
|
|
** Space to hold the returned string is obtained from
|
|
|
|
** Space to hold the returned string is obtained from
|
|
|
|
** sqliteMalloc().
|
|
|
|
** sqliteMalloc().
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
static char *tqunicodeToMbcs(const WCHAR *zWideFilename){
|
|
|
|
static char *unicodeToMbcs(const WCHAR *zWideFilename){
|
|
|
|
int nByte;
|
|
|
|
int nByte;
|
|
|
|
char *zFilename;
|
|
|
|
char *zFilename;
|
|
|
|
int codepage = AreFileApisANSI() ? CP_ACP : CP_OEMCP;
|
|
|
|
int codepage = AreFileApisANSI() ? CP_ACP : CP_OEMCP;
|
|
|
@ -16335,7 +16335,7 @@ static char *mbcsToUtf8(const char *zFilename){
|
|
|
|
if( zTmpWide==0 ){
|
|
|
|
if( zTmpWide==0 ){
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
zFilenameUtf8 = tqunicodeToUtf8(zTmpWide);
|
|
|
|
zFilenameUtf8 = unicodeToUtf8(zTmpWide);
|
|
|
|
sqliteFree(zTmpWide);
|
|
|
|
sqliteFree(zTmpWide);
|
|
|
|
return zFilenameUtf8;
|
|
|
|
return zFilenameUtf8;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -16352,7 +16352,7 @@ static char *utf8ToMbcs(const char *zFilename){
|
|
|
|
if( zTmpWide==0 ){
|
|
|
|
if( zTmpWide==0 ){
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
zFilenameMbcs = tqunicodeToMbcs(zTmpWide);
|
|
|
|
zFilenameMbcs = unicodeToMbcs(zTmpWide);
|
|
|
|
sqliteFree(zTmpWide);
|
|
|
|
sqliteFree(zTmpWide);
|
|
|
|
return zFilenameMbcs;
|
|
|
|
return zFilenameMbcs;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -17025,7 +17025,7 @@ SQLITE_PRIVATE int sqlite3WinTempFileName(char *zBuf){
|
|
|
|
char *zMulti;
|
|
|
|
char *zMulti;
|
|
|
|
WCHAR zWidePath[SQLITE_TEMPNAME_SIZE];
|
|
|
|
WCHAR zWidePath[SQLITE_TEMPNAME_SIZE];
|
|
|
|
GetTempPathW(SQLITE_TEMPNAME_SIZE-30, zWidePath);
|
|
|
|
GetTempPathW(SQLITE_TEMPNAME_SIZE-30, zWidePath);
|
|
|
|
zMulti = tqunicodeToUtf8(zWidePath);
|
|
|
|
zMulti = unicodeToUtf8(zWidePath);
|
|
|
|
if( zMulti ){
|
|
|
|
if( zMulti ){
|
|
|
|
strncpy(zTempPath, zMulti, SQLITE_TEMPNAME_SIZE-30);
|
|
|
|
strncpy(zTempPath, zMulti, SQLITE_TEMPNAME_SIZE-30);
|
|
|
|
zTempPath[SQLITE_TEMPNAME_SIZE-30] = 0;
|
|
|
|
zTempPath[SQLITE_TEMPNAME_SIZE-30] = 0;
|
|
|
@ -17513,7 +17513,7 @@ SQLITE_PRIVATE char *sqlite3WinFullPathname(const char *zRelative){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
GetFullPathNameW((WCHAR*)zConverted, nByte, zTemp, 0);
|
|
|
|
GetFullPathNameW((WCHAR*)zConverted, nByte, zTemp, 0);
|
|
|
|
sqliteFree(zConverted);
|
|
|
|
sqliteFree(zConverted);
|
|
|
|
zFull = tqunicodeToUtf8(zTemp);
|
|
|
|
zFull = unicodeToUtf8(zTemp);
|
|
|
|
sqliteFree(zTemp);
|
|
|
|
sqliteFree(zTemp);
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
char *zTemp;
|
|
|
|
char *zTemp;
|
|
|
@ -53685,7 +53685,7 @@ static int sqlite3Prepare16(
|
|
|
|
|
|
|
|
|
|
|
|
if( zTail8 && pzTail ){
|
|
|
|
if( zTail8 && pzTail ){
|
|
|
|
/* If sqlite3_prepare returns a tail pointer, we calculate the
|
|
|
|
/* If sqlite3_prepare returns a tail pointer, we calculate the
|
|
|
|
** equivalent pointer into the UTF-16 string by counting the tqunicode
|
|
|
|
** equivalent pointer into the UTF-16 string by counting the unicode
|
|
|
|
** characters between zSql8 and zTail8, and then returning a pointer
|
|
|
|
** characters between zSql8 and zTail8, and then returning a pointer
|
|
|
|
** the same number of characters into the UTF-16 string.
|
|
|
|
** the same number of characters into the UTF-16 string.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -67205,7 +67205,7 @@ SQLITE_API const char *sqlite3_errmsg(sqlite3 *db){
|
|
|
|
** error.
|
|
|
|
** error.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
SQLITE_API const void *sqlite3_errmsg16(sqlite3 *db){
|
|
|
|
SQLITE_API const void *sqlite3_errmsg16(sqlite3 *db){
|
|
|
|
/* Because all the characters in the string are in the tqunicode
|
|
|
|
/* Because all the characters in the string are in the unicode
|
|
|
|
** range 0x00-0xFF, if we pad the big-endian string with a
|
|
|
|
** range 0x00-0xFF, if we pad the big-endian string with a
|
|
|
|
** zero byte, we can obtain the little-endian string with
|
|
|
|
** zero byte, we can obtain the little-endian string with
|
|
|
|
** &big_endian[1].
|
|
|
|
** &big_endian[1].
|
|
|
|