On 2 Jun 2017, at 1:06am, Pavel Machala <[email protected]> wrote:

> Questions coming from these observed issues are: 
> - Why is the issue in first case so consistent for fields created with 
> StringBuilder?
> - Is there anything we could do to avoid it or at least do some further 
> debugging?
> - What could cause such a rare corruption in second case?

Thank you for a thorough description of your problem.  It saves a lot of time.

These problems are often related to Code Page problems.  SQLite considers that 
all strings are Unicode.  If you are passing it ASCII strings, or using strings 
in a Code Page encoding, you will get strange results.  I don’t know anything 
about your programming library but please check to see if you need to do, or if 
it has, a "convert to Unicode" function.

There are two problems which might be happening.  One is that you are storing 
the wrong thing in the database.  The other is that your program is not 
correctly handling what’s returned when you query the database.  You can find 
out which using the SQLite Shell Tool:

<https://sqlite.org/cli.html>

You can download it under "Precompiled Binaries" from here:

<https://sqlite.org/download.html>

Copy your database onto a computer and use this shell tool to check what is 
stored in it.  You can also use the shell tool to correctly insert a Unicode 
string and see whether this gives the same results as strings inserted by your 
software.

Please feel free to post again after investigating if this doesn’t solve your 
problem.

Simon.
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to