Theos PowerBasic Museum 2017

Webmaster: José Roca (PBWIN 10+/PBCC 6+) (SDK Forum) => Discussion => Topic started by: Eddy Larsson on September 09, 2012, 11:51:56 AM

Title: How to use swedish characters in sqlite_exec ?
Post by: Eddy Larsson on September 09, 2012, 11:51:56 AM
Hi

I have problem with Swedish characters in sqlite_exec.
When I use the following sql string.
Sql = "SELECT * FROM [lager] where [avd] like 'bröd'  LIMIT 1"
Nothing returns.
But if I put the  wildcard '%' instead of 'ö' it  returns data
Sql = "SELECT * FROM [lager] where [avd] like 'br%d'  LIMIT 1"

I have tried to find features in the pbmanual  without success.
Is there a way to send sql string with Swedish characters without using wilcard?

In the SQLite_Exec_Callback I  have used the Utf8ToChr$ function to display Swedish characters
?" Column value: "& Utf8ToChr$ (@ColValues ​​(i))"


Attach a screenshot how it looks when wildcar % used

Regards
Eddy
Title: Re: How to use swedish characters in sqlite_exec ?
Post by: José Roca on September 09, 2012, 10:28:38 PM
Maybe sending it UTF8 encoded. SQLite does not use ansi, but UTF8.
Title: Re: How to use swedish characters in sqlite_exec ?
Post by: Eddy Larsson on September 10, 2012, 07:51:38 AM
Hi
I thought I had tried all the string functions before I started this topic, but apparently not.

This works.
Sql =ChrToUtf8$("SELECT * FROM [lager] where [avd] like 'bröd'  LIMIT 1")

Thanks for your advice.

Regards
Eddy