diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-17 01:28:26 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-12-17 01:28:26 +0000 |
| commit | 8e2e0c5ca3d87b96df5a55a1275dd8f2f22a6ce7 (patch) | |
| tree | c4fe1447f18ac861210664f44e8954270f68af4a /transcode.c | |
| parent | 8d4f74ffd01221cc39d7fbccd8185d23c934f38a (diff) | |
| download | ruby-8e2e0c5ca3d87b96df5a55a1275dd8f2f22a6ce7.tar.gz ruby-8e2e0c5ca3d87b96df5a55a1275dd8f2f22a6ce7.tar.xz ruby-8e2e0c5ca3d87b96df5a55a1275dd8f2f22a6ce7.zip | |
for undefined conversions.
* transcode_data_iso_8859.c: Changed from character constants
('\xC2') to integer contants (0xC2) for shorter files and
better readability; eliminated duplicated tables; changed
from -1 offset to actual UNDEF entry (not yet distinguishing
UNDEF and ILLEGAL correctly).
* test/ruby/test_transcode.rb: added a test for UNDEF conversion.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'transcode.c')
| -rw-r--r-- | transcode.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/transcode.c b/transcode.c index 30901e6df..bf482bb0a 100644 --- a/transcode.c +++ b/transcode.c @@ -191,7 +191,6 @@ transcode_loop(char **in_pos, char **out_pos, next_byte = (unsigned char)*in_p++; follow_byte: next_offset = next_table->base[next_byte]; - if (next_offset == (base_element)-1) goto illegal; next_info = (VALUE)next_table->info[next_offset]; switch (next_info & 0x1F) { case NOMAP: @@ -234,7 +233,7 @@ transcode_loop(char **in_pos, char **out_pos, goto illegal; case UNDEF: /* todo: add code for alternative behaviors */ - rb_raise(rb_eRuntimeError /*@@@change exception*/, "conversion undefined for byte sequence"); + rb_raise(rb_eRuntimeError /*@@@change exception*/, "conversion undefined for byte sequence (maybe illegal byte sequence)"); continue; } continue; |
