when SQLiteCommand text contains Chinaese character "大",it will crash everytime.

Apr 6, 2012 at 3:22 AM

private void btnSelect_Click(object sender, RoutedEventArgs e)
        {
            lbOutput.Text = "";
            if (db != null)
            {
                DateTime start = DateTime.Now;
                try
                {
                    //List<Test> lst=new List<Test>();
                    SQLiteCommand cmd = db.CreateCommand("SELECT * FROM test where name='大'");
                    var lst = cmd.ExecuteQuery<Test>();
                    lbOutput.Text += "Selected " + lst.ToList().Count + " items\r\nTime " + (DateTime.Now - start).TotalSeconds;
                }
                catch (SQLiteException ex)
                {
                    lbOutput.Text += "Error: " + ex.Message;
                }
            }
        }

A first chance exception of type 'System.IndexOutOfRangeException' occurred in Community.CsharpSqlite.WP.dll

tokenize_c.cs

if ( ( iOffset + i == z.Length && c != delim ) || z[iOffset + i] != delim )   //exception occurred  
            {
              tokenType = TK_ILLEGAL;
              return i + 1;
            }