Ok thanks for all the great feedback!  Im a bit familiar with
MySQL but new to Sqlite, and certainly dont know any
of the optimizations you've suggested, so I appreciate all
of the feedback.

Using iconv on the original text file, then running my program
worked.  Ill look into the other suggestions next.  I run this
program once before I install the DB's, so performance isnt
an issue, but I will still look at the other suggestions to learn
more.

Thank you all so much!

On Wed, Sep 30, 2009 at 5:10 AM, Simon Slavin
<slav...@hearsay.demon.co.uk>wrote:

>
> On 30 Sep 2009, at 4:56am, Bible Trivia Extreme wrote:
>
> > Open your spanish.txt file in a hex editor.  The letter 'ñ' should be
> >
> >> encoded as C3 B1.  If you see F1 instead, it means your file is in
> >> ISO-8859-1 or something similar.
> >> _______________________________________________
> >>
> >> Thanks Dan, it seems to be F1.  So what do I do exactly?
> > Im assuming I need to fix the .txt file somehow, but how?
>
> The text file you are reading your data from is an ASCII text file,
> not a Unicode text file.  So the ñ character you read from it is in
> ASCII, and that's what you're writing to your database.
>
> You can convert the text file you're reading from into Unicode (iconv
> is fine).  Or you can use a C call to convert the data you read from
> the file, line by line, from whatever standard it is in (ISO-8859-1 ?)
> into Unicode before you use it in your sqlite3_exec() call.  Depends
> on whether you're just using the file once or it it's constantly being
> remade by something else you can't control.
>
> Roger advised you upthread to stop using sqlite3_exec() and do
> _prepare, _step, _finalise.  There are good reasons why he's right,
> but there are also good reasons to use _exec under certain
> circumstances.  You'll have to weigh up the advantages and
> disadvantages yourself.  He's right about the PRAGMA, though: you
> don't need it.
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to