ruby-cvs:21356
From: akr ruby-lang.org
Date: Thu, 6 Dec 2007 18:28:27 +0900 (JST)
Subject: [ruby-cvs:21356] Ruby:r14119 (trunk): * encoding.c (rb_enc_precise_mbclen): new function for mbclen with
akr 2007-12-06 18:28:26 +0900 (Thu, 06 Dec 2007)
New Revision: 14119
Modified files:
trunk/ChangeLog
trunk/enc/euc_jp.c
trunk/enc/sjis.c
trunk/enc/utf8.c
trunk/encoding.c
trunk/include/ruby/encoding.h
trunk/include/ruby/oniguruma.h
trunk/io.c
trunk/string.c
trunk/test/ruby/test_m17n.rb
Log:
* encoding.c (rb_enc_precise_mbclen): new function for mbclen with
validation.
* include/ruby/encoding.h (rb_enc_precise_mbclen): declared.
(MBCLEN_CHARFOUND): new macro.
(MBCLEN_INVALID): new macro.
(MBCLEN_NEEDMORE): new macro.
* include/ruby/oniguruma.h (OnigEncodingTypeST): replace mbc_enc_len
by precise_mbc_enc_len.
(ONIGENC_PRECISE_MBC_ENC_LEN): new macro.
(ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND): new macro.
(ONIGENC_CONSTRUCT_MBCLEN_INVALID): new macro.
(ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE): new macro.
(ONIGENC_MBCLEN_CHARFOUND): new macro.
(ONIGENC_MBCLEN_INVALID): new macro.
(ONIGENC_MBCLEN_NEEDMORE): new macro.
(ONIGENC_MBC_ENC_LEN): use ONIGENC_PRECISE_MBC_ENC_LEN.
* enc/euc_jp.c: validation implemented.
* enc/sjis.c: ditto.
* enc/utf8.c: ditto.
* string.c (rb_str_inspect): use rb_enc_precise_mbclen for invalid
encoding.
(rb_str_valid_encoding_p): new method String#valid_encoding?.
* io.c (rb_io_getc): use rb_enc_precise_mbclen.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/include/ruby/oniguruma.h?r1=14119&r2=14118
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/enc/utf8.c?r1=14119&r2=14118
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/string.c?r1=14119&r2=14118
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=14119&r2=14118
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/io.c?r1=14119&r2=14118
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/include/ruby/encoding.h?r1=14119&r2=14118
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/enc/euc_jp.c?r1=14119&r2=14118
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/enc/sjis.c?r1=14119&r2=14118
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/encoding.c?r1=14119&r2=14118
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/ruby/test_m17n.rb?r1=14119&r2=14118