SQLite commands not accepting greek chars?

For everything that's not in any way related to PureBasic. General chat etc...
User avatar
doctorized
Addict
Addict
Posts: 882
Joined: Fri Mar 27, 2009 9:41 am
Location: Athens, Greece

SQLite commands not accepting greek chars?

Post by doctorized »

Once upon a time I wrote an app that saved/read data to a sqlite db. I experienced problems when using greek chars in queries. For example:
Select id from Persons where name = ‘αα’
(α is a in Greek)
Using programs like DB Browser for SQLite, the above command returns the correct value. In my app it returns nothing, null. The query is writen in an EditorGadget. I guess I found a solution back then, searched my posts and didn’t find anything here in this forum. The code was lost when the HDD died some years ago and the code was rewritten and enhanced. Now, I deal with the same problem as I have to update the app. Any suggestions what is going on?

EDIT: seems like it accepts only the word 'select'. 'Select' and 'SELECT' are not working. When the query is created by the app and not taken from the EditorGadget, like:

Code: Select all

CheckDatabaseQuery(#db, "select id from Persons where name = '" + name$ + "'")
then it is not working. What is going on anyway?
User avatar
spikey
Enthusiast
Enthusiast
Posts: 778
Joined: Wed Sep 22, 2010 1:17 pm
Location: United Kingdom

Re: SQLite commands not accepting greek chars?

Post by spikey »

My first thought is that it sounds like an encoding problem but we don't have enough information to answer properly. Are you presenting a database created with the binaries of your lost source to an app created with a more recent compiler or a fresh database created with the new binaries?

When you intimate "old", how old is old? Pre or post 5.50? This is the threshold for internal ASCII/Unicode representation.

IE could there be an encoding mismatch?

Issue:

Code: Select all

pragma encoding;
The result should tell you what encoding was used to create the database.
Which version of the compiler are you using? There appear to be a few unresolved encoding type bugs in the current beta at present.
Which compiler backend are you using, ASM or C? It may make a difference.
Post Reply