mainjo / csharp-sqlite

Automatically exported from code.google.com/p/csharp-sqlite
Other
0 stars 0 forks source link

If the SQL statement has Chinese characters in an error will occur #52

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Example:

SELECT id FROM tbl WHERE name = '中文'

Original issue reported on code.google.com by loveyuki on 19 Feb 2010 at 12:59

GoogleCodeExporter commented 9 years ago
Input strings must be UTF-8;

Changes made to Community.CsharpSqlite.SQLiteClient to accomodate UTF-8

Original comment by noah.hart@gmail.com on 19 Feb 2010 at 11:19

GoogleCodeExporter commented 9 years ago
thanks.

no error run sql

bug can't get any record

Original comment by loveyuki on 20 Feb 2010 at 7:27

GoogleCodeExporter commented 9 years ago
Please submit the series of SQL statements you are using.

Which of the solutions are you running this in?

Original comment by noah.hart@gmail.com on 20 Feb 2010 at 4:50

GoogleCodeExporter commented 9 years ago
i fix this error

SqliteError err = (SqliteError)csSQLite.sqlite3_prepare(parent_conn.Handle2, 
pzStart,
encoding.GetBytes(pzStart).Length, ref pStmt, ref pzTail);

change to:

SqliteError err = (SqliteError)csSQLite.sqlite3_prepare(parent_conn.Handle2, 
pzStart,
pzStart.Length, ref pStmt, ref pzTail);

not use ASCIIEncoding

Original comment by loveyuki on 21 Feb 2010 at 3:38

GoogleCodeExporter commented 9 years ago
Fixed in 20-Feb Check-ing
changeset 52:c1b41c1ffdff

Original comment by noah.hart@gmail.com on 21 Feb 2010 at 4:14

GoogleCodeExporter commented 9 years ago
override public string CommandText
        {
            get { return sql; }
            set {
                sql = value;
                prepared = false; 
            }
        }

this you forget modify.
my english not good .sorry

Original comment by loveyuki on 21 Feb 2010 at 4:29

GoogleCodeExporter commented 9 years ago
SELECT Caption FROM BT_Labels WHERE Caption LIKE '%中文%'

run this sql, get all record ...

english no problem.

i try read code to fix it. but i have time

Original comment by loveyuki on 21 Feb 2010 at 4:31