Quoth "J. Bobby Lopez" <j...@jbldata.com>, on 2010-10-28 11:48:12 -0400:
> And here it is again when less (which doesn't translate the UTF8 text):
> t...@y^@p...@e^@ ^@ ^@ ^@ ^@ ^@ ^...@t^@i...@m^@e^@ ^@ ^@ ^@ ^@ ^@ ^@ ^@ ^@ 
> ^@ ^@ ^@
> ^@ ^@ ^@ ^@ ^@ ^@ ^@ ^@ ^...@u^@s...@e^@r^@ ^@ ^@ ^@ ^@ ^@ ^@
> ^@ ^@ ^@ ^@ ^@ ^@ ^@ ^@ ^@ ^@ ^@ ^@ ^@ 
> ^...@d^@e...@s^@c...@r^@i...@p^@t...@i^@o...@n^@
> ^@ ^@ ^@ ^@ ^@ ^@ ^@ ^@ ^...@^m^@

That's little-endian UTF-16.

> Here is how I'm trying to insert the line into the database (perl):
> 
>         $insert_sql = "insert into data (filename, line) values (" .
> $dbh->quote($file) . "," . $dbh->quote($line) . ")";
>         $dbh->do( $insert_sql );

Don't do that.  Look up how to use placeholders in the DBI manual.

> Another think that crossed my mind is that maybe I haven't set up the
> database properly to accept UTF8 or UTF16 data, but I figured this was a
> default in SQLite3.

You have to pick one when you create the database, usually UTF-8.  If
you want UTF-16 use « PRAGMA encoding = 'UTF-16' » (or 'UTF-16le' or
'UTF-16be') when you create the database.

   ---> Drake Wilson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to