>  but the string "abc" is not 4 bytes long, no matter how you count.

Yes, sorry to cause confusion there, the -2 got in there as in my testing
setup there was always a space before the string to find. This is not
really to do with the problem I am seeing though.

RBS




On Tue, Dec 15, 2015 at 1:22 AM, Igor Tandetnik <igor at tandetnik.org> wrote:

> On 12/14/2015 7:42 PM, Bart Smissaert wrote:
>
>> Yes, str and str2 are Unicode string, 2 bytes per character.
>> lPos counts per character, not byte, so if the string in the database is
>> abcde and I want to find the first position
>> of d in that string then lPos will be 4.
>>
>
> ... and then you pass (lPos-2)*2 == 4 - but the string "abc" is not 4
> bytes long, no matter how you count.
>
> You are converting in one direction (SQLite to VB), but not in the other
>>>
>> I thought SQLite would handle VB Unicode strings to UTF8 strings
>>
>
> It would, if you use the correct API function, so that SQLite knows that
> the string is in fact Unicode.
>
> --
> Igor Tandetnik
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>

Reply via email to