From 415d59e3e43c103b7a642e511abb683c785ef9b6 Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 27 Dec 2008 06:28:34 +0000 Subject: * transcode.c (make_econv_exception): show source and destination encoding. [ruby-dev:37285] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- transcode.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'transcode.c') diff --git a/transcode.c b/transcode.c index 72e26f6df2..f925daa584 100644 --- a/transcode.c +++ b/transcode.c @@ -2005,6 +2005,14 @@ make_econv_exception(rb_econv_t *ec) StringValueCStr(dumped), ec->last_error.source_encoding, ec->last_error.destination_encoding); + if (strcmp(ec->last_error.source_encoding, + ec->source_encoding_name) != 0 || + strcmp(ec->last_error.destination_encoding, + ec->destination_encoding_name) != 0) { + rb_str_catf(mesg, " in conversion from %s to %s", + ec->source_encoding_name, + ec->destination_encoding_name); + } exc = rb_exc_new3(rb_eUndefinedConversionError, mesg); idx = rb_enc_find_index(ec->last_error.source_encoding); if (0 <= idx) -- cgit v1.2.3