Hi Martin,

I had a go using a terminal session, with default encoding UTF-8.

Try using the hex( ) and unicode( ) functions to check what is actually
stored in the sqlite table.

I put a couple of rows at the end of an existing simple table....

kevin@kevin-Aspire-V5-571G:~$ sqlite3 /home/kevin/dir_md5sum_db.sqlite
SQLite version 3.15.2 2016-11-28 19:13:37
Enter ".help" for usage hints.
sqlite> SELECT dir_name, hex(dir_name), dir_md5sum, hex(dir_md5sum),
unicode(dir_md5sum)  FROM dir_md5sum 
   ...> where rowid >= 194576;
194576|kev|6B6576|í|C3AD|237
194577|kev2|6B657632|�|ED|65533
sqlite> .quit
kevin@kevin-Aspire-V5-571G:~$ 



I tried changing the terminal session to UTF-16, but I ended up with a
mess of Chinese characters. 






the � is a place marker inserted by the program that displays on your
screen for a character the program doesn't recognize. 

Check http://www.fileformat.info/info/unicode/char/00ed/index.htm

as a reference.

I use Linux (Xubuntu)


regs,

Kev


From: "Ariel M. Martin" <ariel.mar...@yahoo.com>
To: "   sqlite-users@mailinglists.sqlite.org"
        <sqlite-users@mailinglists.sqlite.org>
Subject: [sqlite] Weird chars inserted
Message-ID: <835952.64146...@smtp113.mail.ne1.yahoo.com>
Content-Type: text/plain; charset="utf-8"

Hi people. I need some help I’m lost here.
I’m writing an application using SQLite and whenever I insert Spanish
characters
I get this kind of strings:
Mart�n (where it should read ‘Martín’)

Ok, so if I open my database with SQLiteManager (the Firefox addin) my
strings look
weird like that. But SQLiteManager is able to insert and display any
string correctly.
And any string inserted by SQLiteManager displays all right in my app
as well.

So I must be doing something wrong when I insert the strings. This is
my code:

Note: szSQL is the wchar-string my app uses

        char szAux[2048];
        ZeroMemory(szAux, 2048);
        WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK, szSQL,
wcslen(szSQL), szAux, 2048, NULL, 0);

        int nRet= sqlite3_exec(m_hDB, szAux, NULL, 0, &pErrMsg);


SQLiteManager tells me that my db is utf-16le. Im using vs2015 in a
Windows10 64bit machine.

I’d appreciate any help.
Thanks in advance!


Ariel M. Martin

_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to