From d68854c07f839371d9da8dceaa291caecee40d33 Mon Sep 17 00:00:00 2001 From: yugui Date: Thu, 15 Jan 2009 15:39:02 +0000 Subject: merges r21509 and r21512 from trunk into ruby_1_9_1. * enc/trans/gb18030.trans, gb18030-tbl.rb: new Chinese GB18030 transcoding (from Yoshihiro Kambayashi) * test/ruby/test_transcode.rb: added tests for the above (from Yoshihiro Kambayashi) * transcode_data.h, transcode.c, tool/transcode_tblgen.rb: added support for GB18030-specific 4-byte sequences (with Yoshihiro Kambayashi) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@21560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- transcode.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'transcode.c') diff --git a/transcode.c b/transcode.c index 4eb947032a..b2d6706f7e 100644 --- a/transcode.c +++ b/transcode.c @@ -501,6 +501,10 @@ transcode_restartable0(const unsigned char **in_pos, unsigned char **out_pos, case 26: goto resume_label26; case 27: goto resume_label27; case 28: goto resume_label28; + case 29: goto resume_label29; + case 30: goto resume_label30; + case 31: goto resume_label31; + case 32: goto resume_label32; } while (1) { @@ -569,6 +573,12 @@ transcode_restartable0(const unsigned char **in_pos, unsigned char **out_pos, SUSPEND_OBUF(18); *out_p++ = getBT2(next_info); SUSPEND_OBUF(19); *out_p++ = getBT3(next_info); continue; + case GB4bt: + SUSPEND_OBUF(29); *out_p++ = getGB4bt0(next_info); + SUSPEND_OBUF(30); *out_p++ = getGB4bt1(next_info); + SUSPEND_OBUF(31); *out_p++ = getGB4bt2(next_info); + SUSPEND_OBUF(32); *out_p++ = getGB4bt3(next_info); + continue; case STR1: tc->output_index = 0; while (tc->output_index < STR1_LENGTH(BYTE_ADDR(STR1_BYTEINDEX(next_info)))) { @@ -2686,9 +2696,9 @@ make_encobj(const char *name) * Encoding::Converter.asciicompat_encoding(string) => encoding or nil * Encoding::Converter.asciicompat_encoding(encoding) => encoding or nil * - * returns the corresponding ASCII compatible encoding. + * Returns the corresponding ASCII compatible encoding. * - * It returns nil if the argument is an ASCII compatible encoding. + * Returns nil if the argument is an ASCII compatible encoding. * * "corresponding ASCII compatible encoding" is a ASCII compatible encoding which * can represents exactly the same characters as the given ASCII incompatible encoding. @@ -3997,7 +4007,7 @@ ecerr_error_bytes(VALUE self) * call-seq: * ecerr.readagain_bytes -> string * - * returns the bytes to be read again when Encoding::InvalidByteSequenceError occur. + * Returns the bytes to be read again when Encoding::InvalidByteSequenceError occurs. */ static VALUE ecerr_readagain_bytes(VALUE self) @@ -4009,7 +4019,7 @@ ecerr_readagain_bytes(VALUE self) * call-seq: * ecerr.incomplete_input? -> true or false * - * returns true if the invalid byte sequence error is caused by + * Returns true if the invalid byte sequence error is caused by * premature end of string. * * ec = Encoding::Converter.new("EUC-JP", "ISO-8859-1") -- cgit v1.2.3