ruby-changes:3793
From: ko1@a...
Date: Mon, 28 Jan 2008 00:39:34 +0900 (JST)
Subject: [ruby-changes:3793] nobu - Ruby:r15282 (trunk): * parse.y (parser_set_encode): check if encoding is ASCII compatible.
nobu 2008-01-28 00:39:14 +0900 (Mon, 28 Jan 2008) New Revision: 15282 Modified files: trunk/ChangeLog trunk/parse.y trunk/version.h Log: * parse.y (parser_set_encode): check if encoding is ASCII compatible. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/version.h?r1=15282&r2=15281&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/parse.y?r1=15282&r2=15281&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=15282&r2=15281&diff_format=u Index: ChangeLog =================================================================== --- ChangeLog (revision 15281) +++ ChangeLog (revision 15282) @@ -1,3 +1,7 @@ +Mon Jan 28 00:39:09 2008 Nobuyoshi Nakada <nobu@r...> + + * parse.y (parser_set_encode): check if encoding is ASCII compatible. + Sun Jan 27 23:33:35 2008 Nobuyoshi Nakada <nobu@r...> * sprintf.c (rb_str_format): fix for left justify flag. Index: parse.y =================================================================== --- parse.y (revision 15281) +++ parse.y (revision 15282) @@ -5746,10 +5746,16 @@ 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 Index: version.h =================================================================== --- version.h (revision 15281) +++ version.h (revision 15282) @@ -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[]; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/