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

* transcode.c (enc_arg): raise exception when unknown encoding is

given.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2008-09-16 16:18:32 +00:00
parent a4523cd042
commit bad9a9ad0d
3 changed files with 11 additions and 21 deletions

View file

@ -1,3 +1,8 @@
Wed Sep 17 01:17:12 2008 NARUSE, Yui <naruse@ruby-lang.org>
* transcode.c (enc_arg): raise exception when unknown encoding is
given.
Tue Sep 16 22:23:24 2008 Takeyuki Fujioka <xibbar@ruby-lang.org>
* lib/cgi/core.rb (CGI#header): performance improvement.

View file

@ -2389,25 +2389,10 @@ rb_econv_open_opts(const char *source_encoding, const char *destination_encoding
static int
enc_arg(volatile VALUE *arg, const char **name_p, rb_encoding **enc_p)
{
rb_encoding *enc;
const char *n;
int encidx;
VALUE encval;
if ((encidx = rb_to_encoding_index(encval = *arg)) < 0) {
enc = NULL;
encidx = 0;
n = StringValueCStr(*arg);
}
else {
enc = rb_enc_from_index(encidx);
n = rb_enc_name(enc);
}
*name_p = n;
rb_encoding *enc = rb_to_encoding(*arg);
*name_p = rb_enc_name(enc);
*enc_p = enc;
return encidx;
return rb_enc_to_index(enc);
}
static int

View file

@ -1,7 +1,7 @@
#define RUBY_VERSION "1.9.0"
#define RUBY_RELEASE_DATE "2008-09-16"
#define RUBY_RELEASE_DATE "2008-09-17"
#define RUBY_VERSION_CODE 190
#define RUBY_RELEASE_CODE 20080916
#define RUBY_RELEASE_CODE 20080917
#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 9
#define RUBY_RELEASE_DAY 16
#define RUBY_RELEASE_DAY 17
#ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[];