Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
7674fd06
Commit
7674fd06
authored
Mar 25, 2004
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #3290 [Ver]: Can't convert sjis&ujis half-width katakana correctly
UJIS part fix
parent
65bed530
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
17 deletions
+60
-17
mysql-test/r/ctype_ujis.result
mysql-test/r/ctype_ujis.result
+28
-0
mysql-test/t/ctype_ujis.test
mysql-test/t/ctype_ujis.test
+20
-0
strings/ctype-ujis.c
strings/ctype-ujis.c
+12
-17
No files found.
mysql-test/r/ctype_ujis.result
View file @
7674fd06
...
...
@@ -64,3 +64,31 @@ select 'A' like 'a';
select 'A' like 'a' collate ujis_bin;
'A' like 'a' collate ujis_bin
0
set @ujis1= _ujis 0x8EA18EA28EA38EA48EA58EA68EA78EA88EA98EAA8EAB8EAC8EAD8EAE8EAF;
set @ujis2= _ujis 0x8EB08EB18EB28EB38EB48EB58EB68EB78EB88EB98EBA8EBB8EBC8EBD8EBE8EBF;
set @ujis3= _ujis 0x8EC08EC18EC28EC38EC48EC58EC68EC78EC88EC98ECA8ECB8ECC8ECD8ECE8ECF;
set @ujis4= _ujis 0x8ED08ED18ED28ED38ED48ED58ED68ED78ED88ED98EDA8EDB8EDC8EDD8EDE8EDF;
select hex(@utf81:= CONVERT(@ujis1 USING utf8));
hex(@utf81:= CONVERT(@ujis1 USING utf8))
EFBDA1EFBDA2EFBDA3EFBDA4EFBDA5EFBDA6EFBDA7EFBDA8EFBDA9EFBDAAEFBDABEFBDACEFBDADEFBDAEEFBDAF
select hex(@utf82:= CONVERT(@ujis2 USING utf8));
hex(@utf82:= CONVERT(@ujis2 USING utf8))
EFBDB0EFBDB1EFBDB2EFBDB3EFBDB4EFBDB5EFBDB6EFBDB7EFBDB8EFBDB9EFBDBAEFBDBBEFBDBCEFBDBDEFBDBEEFBDBF
select hex(@utf83:= CONVERT(@ujis3 USING utf8));
hex(@utf83:= CONVERT(@ujis3 USING utf8))
EFBE80EFBE81EFBE82EFBE83EFBE84EFBE85EFBE86EFBE87EFBE88EFBE89EFBE8AEFBE8BEFBE8CEFBE8DEFBE8EEFBE8F
select hex(@utf84:= CONVERT(@ujis4 USING utf8));
hex(@utf84:= CONVERT(@ujis4 USING utf8))
EFBE90EFBE91EFBE92EFBE93EFBE94EFBE95EFBE96EFBE97EFBE98EFBE99EFBE9AEFBE9BEFBE9CEFBE9DEFBE9EEFBE9F
select @ujis1 = CONVERT(@utf81 USING ujis);
@ujis1 = CONVERT(@utf81 USING ujis)
1
select @ujis2 = CONVERT(@utf82 USING ujis);
@ujis2 = CONVERT(@utf82 USING ujis)
1
select @ujis3 = CONVERT(@utf83 USING ujis);
@ujis3 = CONVERT(@utf83 USING ujis)
1
select @ujis4 = CONVERT(@utf84 USING ujis);
@ujis4 = CONVERT(@utf84 USING ujis)
1
mysql-test/t/ctype_ujis.test
View file @
7674fd06
...
...
@@ -41,3 +41,23 @@ select _ujis 0xa1a2a1a3 like concat(_ujis'%',_ujis 0xa2a1, _ujis'%') collate uji
select
'a'
like
'a'
;
select
'A'
like
'a'
;
select
'A'
like
'a'
collate
ujis_bin
;
#
# Bug 3290: Hald-width Katakana conversion problem.
# Check ujis-utf8-ujis round trip.
#
set
@
ujis1
=
_ujis
0x8EA18EA28EA38EA48EA58EA68EA78EA88EA98EAA8EAB8EAC8EAD8EAE8EAF
;
set
@
ujis2
=
_ujis
0x8EB08EB18EB28EB38EB48EB58EB68EB78EB88EB98EBA8EBB8EBC8EBD8EBE8EBF
;
set
@
ujis3
=
_ujis
0x8EC08EC18EC28EC38EC48EC58EC68EC78EC88EC98ECA8ECB8ECC8ECD8ECE8ECF
;
set
@
ujis4
=
_ujis
0x8ED08ED18ED28ED38ED48ED58ED68ED78ED88ED98EDA8EDB8EDC8EDD8EDE8EDF
;
select
hex
(
@
utf81
:=
CONVERT
(
@
ujis1
USING
utf8
));
select
hex
(
@
utf82
:=
CONVERT
(
@
ujis2
USING
utf8
));
select
hex
(
@
utf83
:=
CONVERT
(
@
ujis3
USING
utf8
));
select
hex
(
@
utf84
:=
CONVERT
(
@
ujis4
USING
utf8
));
select
@
ujis1
=
CONVERT
(
@
utf81
USING
ujis
);
select
@
ujis2
=
CONVERT
(
@
utf82
USING
ujis
);
select
@
ujis3
=
CONVERT
(
@
utf83
USING
ujis
);
select
@
ujis4
=
CONVERT
(
@
utf84
USING
ujis
);
strings/ctype-ujis.c
View file @
7674fd06
...
...
@@ -8342,18 +8342,14 @@ my_mb_wc_euc_jp(CHARSET_INFO *cs,my_wc_t *pwc, const uchar *s, const uchar *e)
static
int
my_wc_mb_euc_jp
(
CHARSET_INFO
*
c
,
my_wc_t
wc
,
unsigned
char
*
s
,
unsigned
char
*
e
)
{
unsigned
char
buf
[
2
];
unsigned
char
c1
;
int
ret
,
jp
;
int
jp
;
if
(
s
>=
e
)
return
MY_CS_TOOSMALL
;
if
((
int
)
wc
<
0x80
)
{
if
(
s
>
e
)
return
MY_CS_TOOSMALL
;
*
s
=
(
uchar
)
wc
;
return
1
;
}
...
...
@@ -8369,21 +8365,20 @@ my_wc_mb_euc_jp(CHARSET_INFO *c,my_wc_t wc, unsigned char *s, unsigned char *e)
return
2
;
}
ret
=
my_wc_mb_jisx0201
(
c
,
wc
,
buf
,
buf
+
2
);
if
(
ret
==
1
)
/* Half width Katakana */
if
(
my_wc_mb_jisx0201
(
c
,
wc
,
s
,
e
)
==
1
)
{
if
(
s
+
1
>
e
)
if
(
s
+
2
>
e
)
return
MY_CS_TOOSMALL
;
s
[
0
]
=
0x8E
;
s
[
1
]
=
buf
[
0
];
return
1
;
s
[
1
]
=
s
[
0
];
s
[
0
]
=
0x8E
;
return
2
;
}
if
((
jp
=
my_uni_jisx0212_onechar
(
wc
)))
{
if
(
s
+
2
>
e
)
if
(
s
+
3
>
e
)
return
MY_CS_TOOSMALL
;
jp
+=
0x8080
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment