Subject After inserting 4683 rows infamous "Cannot transliterate ..." error always
Author Stefan Renzewitz
Hi,

I have read several articles about Firebird and charsets and followed
the guidelines "Everything You Need to Know About InterBase Character
Sets"
(http://blogs.teamb.com/craigstuntz/articles/InterBaseCharsets.aspx),
but so far I have even no clue what's going on.

I'm able to insert exactly 4683 rows via a stored procedure from a
file and then I always get this error message: Cannot transliterate
character between character sets.

Afterwards I can no longer work with the table via the stored
procedure. I even can't query to see if one of the already inserted
entries exists. I have to create a new database which let me repeat
the same procedure. This really bugs me. I mean, if it is a general
mismatch of the charset why can I always insert the same amount of
rows and afterwards I even can't query anymore? Is it possible that
the last successful entry is causing this problem, but how? It's just
a unicode string.

I have set the correct default charset when I create the database (in
my case I have tried with UTF8 and UNICODE_FSS). When I configure the
session and parameters I'm explicitly providing the right charset and
my stored procedure is also using the same charset as well as the
column of the table into which I want to add some entries.

With IB Expert I can open the table and there is nothing special to see.

The stored procedure looks like this:

CREATE PROCEDURE ADD_POSITION (
iswhitetomove char(1),
huffmanfen_input varchar(37))
returns (
position_id integer)
as
begin
SELECT "Position"."HuffmanFen"
FROM "Position"
WHERE "Position"."HuffmanFen" = :huffmanfen_input INTO :position_id;
if (position_id is null) then begin position_id =
gen_id("sq_Position",1); INSERT INTO "Position" (OID,
"Position"."HuffmanFen",
"Position"."IsWhiteToMove") VALUES (:position_id, :huffmanfen_input,
:iswhitetomove); end suspend; end^

==========
It fails at the line "WHERE" where I try to query for :huffmanfen. But
only after inserting 4683 rows.

The input parameter of the SP is charset UNICODE_FSS. But this is not
displayed with IB Expert, if the default charset is the same. I also
tried with default charset none and then explictly set the column of
the table and the input parameter to UNICODE_FSS, same result. I have
also tried UT8.

I'm inserting some unicode stuff for the parameter HuffmanFen like
_ῳ濴替.忿.⿿ャ콯쿿迏겹秿.\0
䈵匔晦晦........쳌쳌ꢛ륺\0

Has anybody an idea for what I should look or how to narrow down the
error a little bit more? I have checked the last inserted row and the
unicode string, but it looks "normal".

Thanks,

Stefan