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

Lost the supplementary characters(UTF-8 4byte) at immediate API handling. [CORE2395] #2815

Closed
firebird-issue-importer opened this issue Mar 28, 2009 · 8 comments

Comments

@firebird-issue-importer

Submitted by: Minoru Yoshida (timeful2)

Attachments:
test.sql
TEST.fbk
test.sql

On V2.0.5 with UTF8 client connection,
Lost the supplementary characters(UTF-8 4byte) at immediate API handling.
e.g. U+20BB7 is UTF-8 4byte character(0xF0A0AEB7)
http://www.unicode.org/cgi-bin/GetUnihanData.pl?codepoint=20bb7

Not immediate API(Using parameter) handling is working fine.
e.g. In Delphi,
...
Query1.SQL.text := 'Insert into TEST(K, N) Values(5,:P1)';
Query1.ParambyName('P1').Asstring := '��';/* 4-Byte UTF-8 0xF0A0AEB7 */
Query1.Execute;
...

The NONE client connection that handling is worked,
and V2.1.2RC all works fine.

Reproduce:
//Please see attachment file.
1. Copy TEST.fdb database to c:\temp folder.
2. Run isql.exe
3. > input test.sql;
4. Open out.txt

Lost the 4-Byte UTF-8 characters...

       K N      

============ ======
1 A
2 ±
3 あ
4
5

-- test.sql(UTF-8 format text)

Set Names UTF8;
Set SQL Dialect 3;
Connect 'c:\temp\TEST.fdb' user 'sysdba' password 'masterkey';

Shell del out.txt;
Output out.txt;

/*Create table*/
Drop table TEST;
Create Table TEST(K INTEGER Not Null, N VARCHAR(1)
, Constraint PK Primary Key (K));

Insert into TEST(K, N) Values(1,'A'); /* 1-Byte UTF-8 0x41 */
Insert into TEST(K, N) Values(2,'±'); /* 2-Byte UTF-8 0xC2B1 */
Insert into TEST(K, N) Values(3,'あ'); /* 3-Byte UTF-8 0xE38182 */
Insert Into TEST(K, N) Values(4,'��'); /* 4-Byte UTF-8 0xF0A0AEB7 */
Insert into TEST(K, N) Values(5,'��'); /* 4-Byte UTF-8 0xF0A0AE9F */
Commit;

Select * from TEST; /* Select all */
Select * from TEST Where N = '%��%'; /* Select 4-Byte UTF-8*/
Commit;

Commits: 3024e8a

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Mar 28, 2009

Modified by: Minoru Yoshida (timeful2)

Attachment: test.sql [ 11430 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Mar 28, 2009

Modified by: Minoru Yoshida (timeful2)

Attachment: TEST.fbk [ 11431 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Mar 28, 2009

Commented by: @asfernandes

Are you really sure V2.0.5 has a problem?

Note: you mixed equal (=) and like (%) in your test case: Where N = '%��%'

Obviously, this will not work in any version.

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Mar 28, 2009

Modified by: Minoru Yoshida (timeful2)

Attachment: test.sql [ 11432 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Mar 28, 2009

Commented by: Minoru Yoshida (timeful2)

>Note: you mixed equal (=) and like (%) in your test case: Where N = '%��%'

Sorry, please change to the following correct statements.

>Select * from TEST Where N = '%��%'; /* Select 4-Byte UTF-8*/

Select * from TEST Where N = '��'; /* Select equal 4-Byte UTF-8*/
Select * from TEST Where N like '%��%'; /* Select like 4-Byte UTF-8*/

>Obviously, this will not work in any version.

What is this mean?

--
Result of V2.0.5:

Select all :
K N
============ ======
1 A
2 ±
3 あ
4
5

Equal:
K N
============ ======
4
5

Like:
K N
============ ======
1 A
2 ±
3 あ
4
5

--
Result of V2.1.2.18118:

Select all :

       K N      

============ ======
1 A
2 ±
3 あ
4 ��
5 ��

Equal:
K N
============ ======
4 ��

Like:
K N
============ ======
4 ��

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Apr 11, 2009

Modified by: @asfernandes

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.0.6 [ 10303 ]

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Nov 12, 2009

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 18, 2016

Modified by: @pavel-zotov

QA Status: No test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants