summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--transcode.c8
2 files changed, 13 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index de5322faab..e50f7b2c74 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Dec 27 15:28:12 2008 Tanaka Akira <akr@fsij.org>
+
+ * transcode.c (make_econv_exception): show source and destination
+ encoding. [ruby-dev:37285]
+
Sat Dec 27 15:23:38 2008 Koichi Sasada <ko1@atdot.net>
* vm_insnhelper.c (vm_yield_with_cfunc): rename parameter name
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)