On 21-12-2014 13:39, Geoff Worboys [email protected] 
[firebird-support] wrote:
> I wrote:
>> This:
>
>> SELECT  Upper(_win1252 'ƒ')  FROM RDB$DATABASE
>
>> (Where 'ƒ' is decimal 131 / 0x83)
>
>> Gives me error 335544321
>> arithmetic exception, numeric overflow, or string truncation
>> Cannot transliterate character between character sets.
>
> I've just answered my own question.
>
> Internal to Firebird the string is converted to Unicode, so
> WIN1252 0x83 becomes U+0192.  This is then converted to
> uppercase which becomes U+0191.  And then it tries to convert
> back to WIN1252 and there is no WIN1252 mapping for that
> unicode character (U+0191).
>
> Bummer.
>
> I can understand the logic in Firebird, but I don't relish
> trying to explain to my customers: this will all work as long
> as they stay away from 'ƒ'.  (Such an explanation is likely
> to have them using words starting with Ƒ, but I will have
> to tell them, they can't use that in this database because we
> don't have a mapping for it. ;-)
>
> As a short term solution I'm going to translate U+0191 back to
> WIN1252 0x83 in my own Firebird build.  Long term I hope to
> move to Unicode.
>
> Thanks for listening, you've been a wonderful audience. :-)

I think this is a bug and it should be reported as such. If there is no 
uppercase equivalent of a character in the current character set, then 
UPPER() should use the character itself, not throw a transliteration error.

However, have you considered using a case insensitive collation instead 
of using UPPER() (assuming the actual problem is with comparisons, not 
with displaying uppercase characters)?

Mark
-- 
Mark Rotteveel

Reply via email to