27.02.2012, 16:34, "Adam Chlipala" <[email protected]>:
> Thus, the question I asked before remains: what is the right way to
> escape UTF-8 strings to use as string literals in MySQL and SQLite?
Hm.
http://sqlite.org/c3ref/exec.html --- "The sqlite3_exec() interface runs zero 
or more UTF-8 encoded, semicolon-separate SQL statements passed into its 2nd 
argument";
http://sqlite.org/lang_expr.html --- "A string constant is formed by enclosing 
the string in single quotes ('). A single quote within the string can be 
encoded by putting two single quotes in a row - as in Pascal. C-style escapes 
using the backslash character are not supported because they are not standard 
SQL."

http://dev.mysql.com/doc/refman/5.0/en/mysql-real-escape-string.html --- 
"Characters encoded are “\”, “'”, “"”, NUL (ASCII 0), “\n”, “\r”, and 
Control+Z. Strictly speaking, MySQL requires only that backslash and the quote 
character used to quote the string in the query be escaped. 
mysql_real_escape_string() quotes the other characters to make them easier to 
read in log files."

> P.S.: You have a comment asking:
>      (* Why "task initialize = init" does not work?
>         But this is the second question. *)
> I uncommented the alternate version and it at least type-checked fine.
> What kind of "not working" have you seen?
It is well-typed, but compiler says:
sql_unicode.ur:27:0-27:22: Initializer has not been fully determined

_______________________________________________
Ur mailing list
[email protected]
http://www.impredicative.com/cgi-bin/mailman/listinfo/ur

Reply via email to