diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-27 15:39:14 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-27 15:39:14 +0000 |
commit | 7c69f166bd05703ecf8ed07fac0927f5fc9b22fa (patch) | |
tree | 941429be2fdbf19abca1785b2020a956692ee2fd | |
parent | b980803a6e89c8e8b951fe6090fca8f083ef4687 (diff) | |
download | ruby-7c69f166bd05703ecf8ed07fac0927f5fc9b22fa.tar.gz |
* parse.y (parser_set_encode): check if encoding is ASCII compatible.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | parse.y | 8 | ||||
-rw-r--r-- | version.h | 6 |
3 files changed, 14 insertions, 4 deletions
@@ -1,3 +1,7 @@ +Mon Jan 28 00:39:09 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * parse.y (parser_set_encode): check if encoding is ASCII compatible. + Sun Jan 27 23:33:35 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> * sprintf.c (rb_str_format): fix for left justify flag. @@ -5746,10 +5746,16 @@ static void parser_set_encode(struct parser_params *parser, const char *name) { int idx = rb_enc_find_index(name); + rb_encoding *enc; + if (idx < 0) { rb_raise(rb_eArgError, "unknown encoding name: %s", name); } - parser->enc = rb_enc_from_index(idx); + enc = rb_enc_from_index(idx); + if (!rb_enc_asciicompat(enc)) { + rb_raise(rb_eArgError, "%s is not ASCII compatible", rb_enc_name(enc)); + } + parser->enc = enc; } #ifndef RIPPER @@ -1,7 +1,7 @@ #define RUBY_VERSION "1.9.0" -#define RUBY_RELEASE_DATE "2008-01-26" +#define RUBY_RELEASE_DATE "2008-01-28" #define RUBY_VERSION_CODE 190 -#define RUBY_RELEASE_CODE 20080126 +#define RUBY_RELEASE_CODE 20080128 #define RUBY_PATCHLEVEL 0 #define RUBY_VERSION_MAJOR 1 @@ -9,7 +9,7 @@ #define RUBY_VERSION_TEENY 0 #define RUBY_RELEASE_YEAR 2008 #define RUBY_RELEASE_MONTH 1 -#define RUBY_RELEASE_DAY 26 +#define RUBY_RELEASE_DAY 28 #ifdef RUBY_EXTERN RUBY_EXTERN const char ruby_version[]; |