The sequence of calls is: 1. sqlite3_step() 2. sqlite3_column_text16() 3. sqlite3_column_bytes()
Please see the attached example program. Regards, Michael > What is the exact sequence of calls? > > If you call sqlite3_column_text() on a blob value, the new type will > be text and a subsequent call to sqlite_column_text16() must by > definition perform transcoding. > > -----Urspr?ngliche Nachricht----- > Von: sqlite-users-bounces at mailinglists.sqlite.org > [mailto:sqlite-users-bounces at mailinglists.sqlite.org] Im Auftrag von > Michael Kaufmann > Gesendet: Donnerstag, 17. Dezember 2015 10:41 > An: sqlite-users at mailinglists.sqlite.org > Betreff: [sqlite] Missing documentation about BLOB encoding conversions > > Hi, > > I expected that BLOB data is returned unchanged by > sqlite3_column_blob(), sqlite3_column_text() and > sqlite3_column_text16(). The documentation at > https://www.sqlite.org/c3ref/column_blob.html says: "Type > conversions and pointer invalidations might occur in the following > cases: ... The initial content is a BLOB and sqlite3_column_text() or > sqlite3_column_text16() is called. A zero-terminator might need to > be added to the string." > > I have found out that SQLite does more than just adding a zero > terminator. It seems that BLOBs are converted from UTF-8 to UTF-16 > when sqlite3_column_text16() is called. > > This is quite unexpected, and it would be nice if the rules for BLOB > encodings and BLOB encoding conversions were pointed out in the > documentation. > > Regards, > Michael > > _______________________________________________ > sqlite-users mailing list > sqlite-users at mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > > > ___________________________________________ > Gunter Hick > Software Engineer > Scientific Games International GmbH > FN 157284 a, HG Wien > Klitschgasse 2-4, A-1130 Vienna, Austria > Tel: +43 1 80100 0 > E-Mail: hick at scigames.at > > This communication (including any attachments) is intended for the > use of the intended recipient(s) only and may contain information > that is confidential, privileged or legally protected. Any > unauthorized use or dissemination of this communication is strictly > prohibited. If you have received this communication in error, please > immediately notify the sender by return e-mail message and delete > all copies of the original communication. Thank you for your > cooperation. > > > _______________________________________________ > sqlite-users mailing list > sqlite-users at mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users