Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange error with text concatention UTF8+win1250 #8435

Closed
Dzyszla opened this issue Feb 11, 2025 · 9 comments · Fixed by #8483
Closed

Strange error with text concatention UTF8+win1250 #8435

Dzyszla opened this issue Feb 11, 2025 · 9 comments · Fixed by #8483

Comments

@Dzyszla
Copy link

Dzyszla commented Feb 11, 2025

I have two selects:

SELECT 'u' || CAST('Kwota faktury płatna wyłącznie na rachunek ING Commercial Finance Polska S.A.,
ul. Malczewskiego 45, 02-622 Warszawa, www.ingcomfin.pl
Bank: ING Bank Śląski
rachunek nr: PL33 1050 0099 5381 0000 1000 9471
któremu zbyliśmy nasze wierzytelności łącznie z niniejszą.' AS BLOB CHARACTER SET win1250)
FROM rdb$database

SELECT 'u' || CAST(' Kwota faktury płatna wyłącznie na rachunek ING Commercial Finance Polska S.A.,
ul. Malczewskiego 45, 02-622 Warszawa, www.ingcomfin.pl
Bank: ING Bank Śląski
rachunek nr: PL33 1050 0099 5381 0000 1000 9471
któremu zbyliśmy nasze wierzytelności łącznie z niniejszą.' AS BLOB CHARACTER SET win1250)
FROM rdb$database

execute on connection UTF8.
FB 3.0.12

First not working, second (add space in casting string) working. Something else changed - working.

What's wrong?

@mrotteveel
Copy link
Member

What is the error?

@Dzyszla
Copy link
Author

Dzyszla commented Feb 12, 2025

Cannot transliterate character between character sets.

@Dzyszla Dzyszla changed the title Strange error with text conversion Strange error with text concatention UTF8+win1250 Feb 12, 2025
@Dzyszla
Copy link
Author

Dzyszla commented Feb 12, 2025

Affected on 4.0.5 too.

@mrotteveel
Copy link
Member

I can reproduce it (tried with DBeaver), but I have no clue why.

@mrotteveel
Copy link
Member

Also on 5.0.1

@Dzyszla
Copy link
Author

Dzyszla commented Feb 12, 2025

Workaround (I think) for now - make explicit cast second field on utf8 (after cast as win1250 - in fact, this query simulates a database field that is in this encoding):

SELECT 'u' || CAST(CAST('Kwota faktury płatna wyłącznie na rachunek ING Commercial Finance Polska S.A.,
ul. Malczewskiego 45, 02-622 Warszawa, www.ingcomfin.pl
Bank: ING Bank Śląski
rachunek nr: PL33 1050 0099 5381 0000 1000 9471
któremu zbyliśmy nasze wierzytelności łącznie z niniejszą.' AS BLOB SUB_TYPE text CHARACTER SET win1250) AS BLOB SUB_TYPE text CHARACTER SET utf8)
FROM rdb$database

@asfernandes
Copy link
Member

I'm already debuging it and found where the problem is. The problem is highly dependent on the blob content where the WIN1250 character is a multibyte character in UTF8 and cannot be fit in the converted buffer.

@Dzyszla
Copy link
Author

Dzyszla commented Feb 12, 2025

I hope it is fixable. :) Are you planning to fix it in v. 3?

@asfernandes
Copy link
Member

I hope it is fixable. :) Are you planning to fix it in v. 3?

I hope so, but we need to take care, it's complicated routine with the bug there much probably for decades.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment