• Welcome to Theos PowerBasic Museum 2017.

News:

Attachments are only available to registered users.
Please register using your full, real name.

Main Menu

How to use swedish characters in sqlite_exec ?

Started by Eddy Larsson, September 09, 2012, 11:51:56 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Eddy Larsson

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

José Roca

#1
Maybe sending it UTF8 encoded. SQLite does not use ansi, but UTF8.

Eddy Larsson

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