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
wrong order for Chinese characters with CHARACTER SET GBK [CORE1335] #1754
Comments
Commented by: henryxu (henryxu) 1. CHARACTER SET is GBK |
Modified by: henryxu (henryxu)Attachment: TESTGBK.FDB [ 10450 ] |
Modified by: henryxu (henryxu)environment: System: Winxp Sp2 => System: Winxp Sp2 |
Commented by: henryxu (henryxu) Sorry,because the size of database is big,now I upload the INSERT SCRIPT. |
Modified by: henryxu (henryxu)Attachment: InsertSQL.sql [ 10451 ] |
Commented by: @pcisar Zip it and use "Attach file". |
Commented by: morgan mo (morgan) It likes order by UCS. The GB 2312 part contain 6763 Chinese character , it is as same as GB2312, so the order of character is PinYin and character strokes as the GB2312. The simplest way that deal with the order of GBK Chinese character maybe is add the collation to GB2312. |
Commented by: @asfernandes Yes, it orders in binary encode order. |
Commented by: @asfernandes Argh... I didn't want to resolve it. |
Modified by: @pcisarWorkflow: jira [ 12480 ] => Firebird [ 15241 ] |
Submitted by: henryxu (henryxu)
Attachments:
TESTGBK.FDB
InsertSQL.sql
There's wrong order for Chinese characters if database is with CHARACTER SET GBK.
Test case:
1. Create Database
SET SQL DIALECT 3;
CREATE DATABASE 'D:\TestGBK.fdb'
USER 'SYSDBA' PASSWORD 'masterkey'
PAGE_SIZE 4096
DEFAULT CHARACTER SET GBK
2.Create Table
CREATE TABLE TB_CHINAPORT (
FID BIGINT NOT NULL,
FPORTCH VARCHAR(20),
FPORTEN VARCHAR(20));
3.Insert Record
INSERT INTO TB_CHINAPORT (FID, FPORTCH, FPORTEN) VALUES (1, '??', 'SHANGHAI');
INSERT INTO TB_CHINAPORT (FID, FPORTCH, FPORTEN) VALUES (2, '??', 'NINGBO');
INSERT INTO TB_CHINAPORT (FID, FPORTCH, FPORTEN) VALUES (3, '??', 'SHENZHEN');
INSERT INTO TB_CHINAPORT (FID, FPORTCH, FPORTEN) VALUES (4, '??', 'WENZHOU');
INSERT INTO TB_CHINAPORT (FID, FPORTCH, FPORTEN) VALUES (5, '??', 'XIAMEN');
INSERT INTO TB_CHINAPORT (FID, FPORTCH, FPORTEN) VALUES (6, '??', 'ZHANJIANG');
INSERT INTO TB_CHINAPORT (FID, FPORTCH, FPORTEN) VALUES (7, '??', 'DALIAN');
INSERT INTO TB_CHINAPORT (FID, FPORTCH, FPORTEN) VALUES (8, '??', 'QINGDAO');
INSERT INTO TB_CHINAPORT (FID, FPORTCH, FPORTEN) VALUES (9, '??', 'TIANJIN');
INSERT INTO TB_CHINAPORT (FID, FPORTCH, FPORTEN) VALUES (10, '??', 'SHANTOU');
INSERT INTO TB_CHINAPORT (FID, FPORTCH, FPORTEN) VALUES (11, '???', 'ZHANGJIAGANG');
INSERT INTO TB_CHINAPORT (FID, FPORTCH, FPORTEN) VALUES (12, '??', 'GUANGZHOU');
p.s.
Field "FPORTCH": Chinese Port with Chinese characters:
Field "FPORTEN": The Chinese Spell for Field "FPORTCH"
4.Test "ORDER BY"
SELECT FPORTCH ,FPORTEN
FROM TB_CHINAPORT
ORDER BY 1
Result is wrong:
FPORTCH FPORTEN
?? SHANGHAI
?? XIAMEN
?? DALIAN
?? TIANJIN
?? NINGBO
?? GUANGZHOU
??? ZHANGJIAGANG
?? SHANTOU
?? SHENZHEN
?? WENZHOU
?? ZHANJIANG
?? QINGDAO
the correct order(same to ordering by FPORTEN)
FPORTCH FPORTEN
?? DALIAN
?? GUANGZHOU
?? NINGBO
?? QINGDAO
?? SHANGHAI
?? SHANTOU
?? SHENZHEN
?? TIANJIN
?? WENZHOU
?? XIAMEN
??? ZHANGJIAGANG
?? ZHANJIANG
p.s.:
If CHARACTER SET is GB2312,the result is correct.
The text was updated successfully, but these errors were encountered: