projects
/
mono.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d5c88eb
)
[I18N/CJK] iso-2022-jp GetChars() had some bogus conversion ranges.
author
Atsushi Eno
<atsushieno@gmail.com>
Thu, 21 Apr 2016 18:08:23 +0000
(
03:08
+0900)
committer
Atsushi Eno
<atsushieno@gmail.com>
Thu, 21 Apr 2016 18:08:23 +0000
(
03:08
+0900)
mcs/class/I18N/CJK/ISO2022JP.cs
patch
|
blob
|
history
mcs/class/I18N/CJK/Test/texts/japanese-50221.txt
patch
|
blob
|
history
mcs/class/I18N/CJK/Test/texts/japanese-50222.txt
patch
|
blob
|
history
mcs/class/I18N/CJK/Test/texts/japanese-51932.txt
patch
|
blob
|
history
mcs/class/I18N/CJK/Test/texts/japanese-932.txt
patch
|
blob
|
history
mcs/class/I18N/CJK/Test/texts/japanese-utf8.txt
patch
|
blob
|
history
diff --git
a/mcs/class/I18N/CJK/ISO2022JP.cs
b/mcs/class/I18N/CJK/ISO2022JP.cs
index 753b2a36b14bdea8a29b5da3bfbad8f556803c47..3ace52300071ba004f33be384f5ad5842c827f8a 100644
(file)
--- a/
mcs/class/I18N/CJK/ISO2022JP.cs
+++ b/
mcs/class/I18N/CJK/ISO2022JP.cs
@@
-690,7
+690,7
@@
namespace I18N.CJK
// am so lazy, so reusing jis2sjis
int s1 = ((bytes [i] - 1) >> 1) + ((bytes [i] <= 0x5e) ? 0x71 : 0xb1);
int s2 = bytes [i + 1] + (((bytes [i] & 1) != 0) ? 0x20 : 0x7e);
- int v = (s1
- 0x81
) * 0xBC;
+ int v = (s1
<= 0x9F ? (s1 - 0x81) : (s1 - 0xc1)
) * 0xBC;
v += s2 - 0x41;
int ch = ToChar (v);
diff --git
a/mcs/class/I18N/CJK/Test/texts/japanese-50221.txt
b/mcs/class/I18N/CJK/Test/texts/japanese-50221.txt
index ccfe7f457eb559f210a084a5e378651cf861b3c8..afe619503c1b9ba6c784b874839a17953f9f2c8e 100644
(file)
--- a/
mcs/class/I18N/CJK/Test/texts/japanese-50221.txt
+++ b/
mcs/class/I18N/CJK/Test/texts/japanese-50221.txt
@@
-1,4
+1,5
@@
\e
$BF|K\8lJQ49$N
\e
(IC=B
\e
$B"+H>3Q
\e
(I6E
\e
$B$b
\e
(I!T/B9@^H
\e
(B
+[
\e
$BlM
\e
(B]
Mono Directions
diff --git
a/mcs/class/I18N/CJK/Test/texts/japanese-50222.txt
b/mcs/class/I18N/CJK/Test/texts/japanese-50222.txt
index da85bfa269d622e8c4968edd3a81236f84d8f3f3..fb2df61a8416d2f2945758685b7636da40942a7d 100644
(file)
--- a/
mcs/class/I18N/CJK/Test/texts/japanese-50222.txt
+++ b/
mcs/class/I18N/CJK/Test/texts/japanese-50222.txt
@@
-1,4
+1,5
@@
\e
$BF|K\8lJQ49$N
\ e
C=B
\ f
"+H>3Q
\ e
6E
\ f
$b
\ e
!T/B9@^H
\ f
\e
(B
+[
\e
$BlM
\e
(B]
Mono Directions
diff --git
a/mcs/class/I18N/CJK/Test/texts/japanese-51932.txt
b/mcs/class/I18N/CJK/Test/texts/japanese-51932.txt
index c1f06116fbd6452e4dd6448577df1ce0f45992ee..0fd82733278b67a285ecd48da57500e4b27de5e0 100644
(file)
--- a/
mcs/class/I18N/CJK/Test/texts/japanese-51932.txt
+++ b/
mcs/class/I18N/CJK/Test/texts/japanese-51932.txt
@@
-1,4
+1,5
@@
ÆüËܸìÊÑ´¹¤Î
\8e
Ã
\8e
½
\8e
¢«È¾³Ñ
\8e
¶
\8e
Ťâ
\8e
¡
\8e
Ô
\8e
¯
\8e
Â
\8e
¹
\8e
À
\8e
Þ
\8e
È
+[ìÍ]
Mono Directions
diff --git
a/mcs/class/I18N/CJK/Test/texts/japanese-932.txt
b/mcs/class/I18N/CJK/Test/texts/japanese-932.txt
index 596ca1c897f1372164d4602758529a14eb486f1e..21a41ba30e5b319391868f7df5b08666e8e88e33 100644
(file)
--- a/
mcs/class/I18N/CJK/Test/texts/japanese-932.txt
+++ b/
mcs/class/I18N/CJK/Test/texts/japanese-932.txt
@@
-1,4
+1,5
@@
\93
ú
\96
{
\8c
ê
\95
Ï
\8a
·
\82
ÌýÂ
\81
©
\94
¼
\8a
p¶Å
\82
à¡Ô¯Â¹ÀÞÈ
+[æË]
Mono Directions
diff --git
a/mcs/class/I18N/CJK/Test/texts/japanese-utf8.txt
b/mcs/class/I18N/CJK/Test/texts/japanese-utf8.txt
index 3b8c4bdcae341bbed3fde8d36dfc06f914a1a65a..bfb79bf6098d6b0bdebac49e81a907d1b74f54d6 100644
(file)
--- a/
mcs/class/I18N/CJK/Test/texts/japanese-utf8.txt
+++ b/
mcs/class/I18N/CJK/Test/texts/japanese-utf8.txt
@@
-1,4
+1,5
@@
日本語変換のテスツ←半角カナも。ヤッツケダネ
+[賤]
Mono Directions