Subject | Re: [firebird-support] Re: Unicode text in Exception? |
---|---|
Author | Martijn Tonies (Upscene Productions) |
Post date | 2015-01-29T16:15:24Z |
Hello Dmitry,
Or perhaps storing it as UNICODE_FSS, same as $SOURCE or $DESCRIPTIONs are
stored?
select 'ТЕСТ НА БЪЛГАРСКИ'
from rdb$database
begin
exception test _utf8
X'31D0A2D095D0A1D0A220D09DD09020D091D0AAD09BD093D090D0A0D0A1D09AD098';
end
0502040101000700029B110002028006 //
0454455354150F0400210031D0A2D095 // TEST ... ! then the same as above in hex
D0A1D0A220D09DD09020D091D0AAD0
9BD093D090D0A0D0A1D09AD098FFFF
FF0E010201150700000019010000FFFF4C
exception 1 TEST 1ТЕСТ ÐРБЪЛГÐРСКИ At procedure 'TEST' line:
4, col: 3
This -could- be my error, but how do I verify?
When I try in isql, I get the same.
With regards,
Martijn Tonies
Upscene Productions
http://www.upscene.com
Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird!
>>> btw, in Firebird 3, the RDB$EXCEPTIONS.RDB$MESSAGE is still NONE.No, I meant a runtime encoding when sending the text to the client.
>>
>> Would it make sense to encode the message according to the given
>> connection
>> character set?
>
>Do you mean changing RDB$EXCEPTIONS.RDB$MESSAGE to UTF8? It was
>discussed but ended nowhere.
Or perhaps storing it as UNICODE_FSS, same as $SOURCE or $DESCRIPTIONs are
stored?
>>>> Now, I tried the following in the procedure to work around the above:I'm trying this in Database Workbench, this works:
>>>>
>>>> exception test _utf8 'unicode string here';
>>
>> Any idea why this won't work either? Or at least, not in my test?
>
>I tried without the _utf8 prefix and it worked:
select 'ТЕСТ НА БЪЛГАРСКИ'
from rdb$database
>1) Connect as UTF8 charsetYep.
>2) Create SP with EXCEPTION ERROR 'some Cyrillic string';Done. In the source, I see the following:
begin
exception test _utf8
X'31D0A2D095D0A1D0A220D09DD09020D091D0AAD09BD093D090D0A0D0A1D09AD098';
end
>3) Validate that RDB$PROCEDURES.RDB$PROCEDURE_BLR (notIn the BLR, I see:
>RDB$PROCEDURE_SOURCE!) really contains a Unicode string
0502040101000700029B110002028006 //
0454455354150F0400210031D0A2D095 // TEST ... ! then the same as above in hex
D0A1D0A220D09DD09020D091D0AAD0
9BD093D090D0A0D0A1D09AD098FFFF
FF0E010201150700000019010000FFFF4C
>4) Connect as WIN1251, execute SP - error text is CyrillicWhen executing the procedure, UTF8/WIN1251/WIN1250 connected, I get:
>5) Connect as WIN1250, execute SP - cannot transliterate character
>between character sets
exception 1 TEST 1ТЕСТ ÐРБЪЛГÐРСКИ At procedure 'TEST' line:
4, col: 3
This -could- be my error, but how do I verify?
When I try in isql, I get the same.
With regards,
Martijn Tonies
Upscene Productions
http://www.upscene.com
Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird!