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 [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

