1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* sprintf.c (rb_enc_vsprintf): relaxed the restriction. since the

implementation deeply depends on plain char, so wchar_t based
  encodings are not supported.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2012-01-14 03:02:57 +00:00
parent f2aa0fd5d4
commit c53470fd47
2 changed files with 9 additions and 2 deletions

View file

@ -1,3 +1,9 @@
Sat Jan 14 12:02:55 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
* sprintf.c (rb_enc_vsprintf): relaxed the restriction. since the
implementation deeply depends on plain char, so wchar_t based
encodings are not supported.
Sat Jan 14 12:00:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org> Sat Jan 14 12:00:20 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
* error.c (exc_equal): ignore exceptions during implicit * error.c (exc_equal): ignore exceptions during implicit

View file

@ -1169,8 +1169,9 @@ rb_enc_vsprintf(rb_encoding *enc, const char *fmt, va_list ap)
f._w = 120; f._w = 120;
result = rb_str_buf_new(f._w); result = rb_str_buf_new(f._w);
if (enc) { if (enc) {
if (!rb_enc_asciicompat(enc)) { if (rb_enc_mbminlen(enc) > 1) {
rb_raise(rb_eArgError, "cannot construct ASCII-incompatible encoding string: %s", /* the implementation deeply depends on plain char */
rb_raise(rb_eArgError, "cannot construct wchar_t based encoding string: %s",
rb_enc_name(enc)); rb_enc_name(enc));
} }
rb_enc_associate(result, enc); rb_enc_associate(result, enc);