Hi, thx for clarification. I do no change UTF8-UTF16 (I hope).
I was guessing the sqlite3_value_text was changing because I does this simple test: try-ing passing "aaa" to the function and try-ing a printf("%s",argv[0]); inside the function I have on stdout something like: "P^. " Instead If I use this other printf("%s",sqlite3_value_text(argv[0])); I have correctly "aaa" I don't understand why this difference so my only explanation was that the sqlite was changing. A. 2014-09-19 22:25 GMT+02:00 Richard Hipp <d...@sqlite.org>: > > > On Fri, Sep 19, 2014 at 4:22 PM, Andrea Peri <aperi2...@gmail.com> wrote: >> >> Hi, >> I'm trying to implement a sqlite extension using some string metric >> algorithms. >> >> My goal is to compare two strings and retrieve the metric. >> >> I understand that to use the argv[0] and argv[1] args inside an >> extension function is need to apply to them the >> sqlite3_value_text(...) function. >> >> Unfortunately seem that with this approach in some situations the >> metric of the strings change. >> >> I see this comparing the results frominside the sqlite extension with >> thesame algorithm in a standalone sample program. >> >> I don't know well why is happening this but I guess it is due to the >> sqlite3_value_text(..) >> >> Is this possible ? And there is an alternative approach to avoid to >> use the sqlite3_value_text(...) ? > > > Unless you are doing UTF8<->UTF16 conversions, the output of > sqlite3_value_text() will be exactly, bit-for-bit, what you put in. Except > for doing conversions between UTF8 and UTF16, SQLite never changes the text > in any way. > > -- > D. Richard Hipp > d...@sqlite.org -- ----------------- Andrea Peri . . . . . . . . . qwerty àèìòù ----------------- _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users