Subject Re: [firebird-support] understanding characters sets
Author Adriano dos Santos Fernandes
Kjell Rilbe escreveu:
> Milan Babuskov wrote:
>
> Thanks Milan. So all in all, the client should always make sure it
> passes "everything" in the connection's character set, whatever it's
> going to do, unless the connection has NONE, in which case the client
> should make sure all string constants are in the corresponding column's
> character set and all identifiers in UTF8.
>
One can also use introducer (_<charset-name>):
insert into my_table values (_win1252 'xyz', _utf8 'xyz');

> That would mean that various parts of a query string might use different
> character encodings. How does FB handle that when parsing the query string?
>
It's assumed that all character sets represents letters, numbers and
punctuations as ASCII.

> Come to think of it, what character encoding does Firebird expect the
> query to be when using NONE for the connection?
NONE charset. :-) In this case, it means more or less binary data.

> UTF8? And then when a
> string constant is encountered, it's assumed to be the same encoding as
> the column it's inserted into, compared to, appended to, or what not?
> So, what happens if this string constant is encoded in such a way that
> it's illegal in UTF8 (or whatever the query string parser expects)? Does
> it work? How?
>
It's assumed to be on the other column charset, but it is verified and
if it isn't, a malformed error is raised.


Adriano