From a9649469b5de1ae185bde4c5dbece6f16e89c85d Mon Sep 17 00:00:00 2001 From: tenderlove Date: Sat, 7 Apr 2012 21:31:43 +0000 Subject: merge revision(s) 35245,35248: * ext/psych/lib/psych.rb: bumping up psych version to match release. * ext/psych/psych.gemspec: ditto * ext/psych/parser.c: fall back to any encoding if the external encoding is wrong. [ruby-core:44163] * test/psych/test_encoding.rb: fix test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@35251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/psych/lib/psych.rb | 2 +- ext/psych/parser.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'ext') diff --git a/ext/psych/lib/psych.rb b/ext/psych/lib/psych.rb index 82578204fb..1895be6193 100644 --- a/ext/psych/lib/psych.rb +++ b/ext/psych/lib/psych.rb @@ -93,7 +93,7 @@ require 'psych/handlers/document_stream' module Psych # The version is Psych you're using - VERSION = '1.3.1' + VERSION = '1.3.2' # The version of libyaml Psych is using LIBYAML_VERSION = Psych.libyaml_version.join '.' diff --git a/ext/psych/parser.c b/ext/psych/parser.c index 9808c6b60e..6f4c4569e9 100644 --- a/ext/psych/parser.c +++ b/ext/psych/parser.c @@ -146,10 +146,11 @@ static VALUE transcode_io(VALUE src, int * parser_encoding) return src; } - rb_raise(rb_eArgError, "YAML file must be UTF-8, UTF-16LE, or UTF-16BE, not %s", - rb_enc_name(rb_enc_from_index(io_external_enc_index))); + /* If the external encoding is something we don't know how to handle, + * fall back to YAML_ANY_ENCODING. */ + *parser_encoding = YAML_ANY_ENCODING; - return Qnil; + return src; } #endif -- cgit v1.2.3