Subject Re: [firebird-python] Re: Can't search DB with accents
Author Philippe Makowski
starglider develop [2010-09-02 21.38] :
I think you need to read about what is a character set

> the databse defenition are:
> SET SQL DIALECT 3;
>
> SET NAMES NONE;
here you say taht you are sending "raw" data, without any character set specified
but if you are under Windows for example and you are sending this through isql, in fact
you are sending win1252 or equivalent depend of your windows language.

> CREATE DATABASE '192.168.0.102:/data/db/livros.fdb'
> USER 'SYSDBA' PASSWORD 'masterkey'
> PAGE_SIZE 16384
> DEFAULT CHARACTER SET NONE;
here you say that you wanted to store data without any character set specified
>
>
> CREATE TABLE LANGUAGES (
> LG_ID INTEGER NOT NULL,
> LG_SHORT VARCHAR(5),
> LG_LONG VARCHAR(30)
> );
same here
IMAHO it is bad you should choose a character set
UFT8 can be a good choice

>
> I execute a query from a self made procedure:
> sql = 'select * from item_log where item_log.il_title containing
> \'Solidão\''
> dataset = dbmain.OutputQuery(param.db_host, param.db_file, sql, False)
> this doesn't give any result.
but what is the character set you use in Python ?
you should take care of it, as in your connection string to the database.
you have to say to Firebird "hello, I will talk to you using this character set"
again utf8 can be a good candidate
without this, Firebird can't know exactly what your are talking about, as soon as you use
a character that is outside the single-byte characters.
Character set NONE makes no character set assumption, storing data exactly as entered.
but in your case ã is not always the same code.
in fact the ã you stored, is not the one your select is asking for.