diff options
| author | duerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-03-16 09:09:53 +0000 |
|---|---|---|
| committer | duerst <duerst@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-03-16 09:09:53 +0000 |
| commit | 4bf4752a04de58fe325678875d11962a9438fa33 (patch) | |
| tree | 452e9c4f33f7c02ea1d088ddb525a836f4ec4037 /enc | |
| parent | f63324b4f64ab008c22290c940d2517d09882b81 (diff) | |
| download | ruby-4bf4752a04de58fe325678875d11962a9438fa33.tar.gz ruby-4bf4752a04de58fe325678875d11962a9438fa33.tar.xz ruby-4bf4752a04de58fe325678875d11962a9438fa33.zip | |
Sun Mar 16 18:07:07 2008 Martin Duerst <duerst@it.aoyama.ac.jp>
* enc/trans/utf_16_32.c: bug fix (some invalid UTF-8 sequences
were legal)
* test/ruby/test_transcode.rb: test for above bug
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enc')
| -rw-r--r-- | enc/trans/utf_16_32.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/enc/trans/utf_16_32.c b/enc/trans/utf_16_32.c index b31adbb7b..045dfcdc0 100644 --- a/enc/trans/utf_16_32.c +++ b/enc/trans/utf_16_32.c @@ -211,7 +211,7 @@ from_UTF_16BE_00_offsets[256] = { static const struct byte_lookup* const from_UTF_16BE_00_infos[1] = { /* used by from_UTF_16BE_00 */ - /* used by to_UTF_32BE_82 */ + /* used by to_UTF_32BE_C2 */ FUNso, }; static const BYTE_LOOKUP @@ -324,8 +324,8 @@ rb_from_UTF_16BE = { }; static const unsigned char -to_UTF_32BE_82_offsets[64] = { - /* used by to_UTF_32BE_82 */ +to_UTF_32BE_C2_offsets[64] = { + /* used by to_UTF_32BE_C2 */ /* used by to_UTF_32BE_E1 */ /* used by to_UTF_32BE_F1 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -334,7 +334,7 @@ to_UTF_32BE_82_offsets[64] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; static const BYTE_LOOKUP -to_UTF_32BE_82 = { +to_UTF_32BE_C2 = { /* used as to_UTF_32BE */ /* used as to_UTF_16BE */ /* used as to_UTF_32BE_E0 */ @@ -363,7 +363,7 @@ to_UTF_32BE_82 = { /* used as to_UTF_32LE_F1_80 */ /* used as to_UTF_16LE_F4_80 */ /* used as to_UTF_32LE_F4_80 */ - to_UTF_32BE_82_offsets, + to_UTF_32BE_C2_offsets, from_UTF_16BE_00_infos }; @@ -378,7 +378,7 @@ to_UTF_32BE_E0_offsets[64] = { }; static const struct byte_lookup* const to_UTF_32BE_E0_infos[2] = { - INVALID, &to_UTF_32BE_82, + INVALID, &to_UTF_32BE_C2, }; static const BYTE_LOOKUP to_UTF_32BE_E0 = { @@ -392,7 +392,7 @@ to_UTF_32BE_E0 = { static const struct byte_lookup* const to_UTF_32BE_E1_infos[1] = { - &to_UTF_32BE_82, + &to_UTF_32BE_C2, }; static const BYTE_LOOKUP to_UTF_32BE_E1 = { @@ -412,13 +412,13 @@ to_UTF_32BE_E1 = { /* used as to_UTF_32LE_F1 */ /* used as to_UTF_16LE_F4 */ /* used as to_UTF_32LE_F4 */ - to_UTF_32BE_82_offsets, + to_UTF_32BE_C2_offsets, to_UTF_32BE_E1_infos }; static const struct byte_lookup* const to_UTF_32BE_ED_infos[2] = { - &to_UTF_32BE_82, INVALID, + &to_UTF_32BE_C2, INVALID, }; static const BYTE_LOOKUP to_UTF_32BE_ED = { @@ -463,7 +463,7 @@ to_UTF_32BE_F1 = { /* used as to_UTF_16BE */ /* used as to_UTF_16LE */ /* used as to_UTF_32LE */ - to_UTF_32BE_82_offsets, + to_UTF_32BE_C2_offsets, to_UTF_32BE_F1_infos }; @@ -491,18 +491,18 @@ to_UTF_32BE_offsets[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 4, 4, 6, 7, 7, 7, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, }; static const struct byte_lookup* const to_UTF_32BE_infos[9] = { - FUNso, INVALID, &to_UTF_32BE_82, &to_UTF_32BE_E0, + FUNso, INVALID, &to_UTF_32BE_C2, &to_UTF_32BE_E0, &to_UTF_32BE_E1, &to_UTF_32BE_ED, &to_UTF_32BE_F0, &to_UTF_32BE_F1, &to_UTF_32BE_F4, }; |
