Index: src/vdbe.c ================================================================== --- src/vdbe.c +++ src/vdbe.c @@ -41,11 +41,11 @@ ** documentation, headers files, or other derived files. The formatting ** of the code in this file is, therefore, important. See other comments ** in this file for details. If in doubt, do not deviate from existing ** commenting and indentation practices when changing or adding code. ** -** $Id: vdbe.c,v 1.496 2005/11/14 22:29:05 drh Exp $ +** $Id: vdbe.c,v 1.497 2005/11/15 02:14:01 drh Exp $ */ #include "sqliteInt.h" #include "os.h" #include #include "vdbeInt.h" @@ -206,12 +206,14 @@ ** Attempt a conversion if pRec has a string representation and ** it looks like a number. */ int realnum; sqlite3VdbeMemNulTerminate(pRec); - if( (pRec->flags&MEM_Str) && sqlite3IsNumber(pRec->z, &realnum, enc) ){ + if( (pRec->flags&MEM_Str) + && sqlite3IsNumber(pRec->z, &realnum, pRec->enc) ){ i64 value; + sqlite3VdbeChangeEncoding(pRec, SQLITE_UTF8); if( !realnum && sqlite3atoi64(pRec->z, &value) ){ sqlite3VdbeMemRelease(pRec); pRec->i = value; pRec->flags = MEM_Int; }else{