encoding.c: add rb_enc_code_to_mbclen

* encoding.c (rb_enc_code_to_mbclen): add new function which returns
  mbclen from codepoint like as rb_enc_codelen() but 0 for invalid
  char.
* include/ruby/encoding.h (rb_enc_code_to_mbclen): declaration and
  shortcut macro.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
string.c: wchar succ

* string.c (enc_succ_char, enc_pred_char): consider wchar case.
  [ruby-core:56071] [Bug #8653]
* string.c (rb_str_succ): do not replace with invalid char.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e