diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-01-25 06:56:26 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-01-25 06:56:26 +0000 |
commit | dfca38eaa2e9b134075742cc59e9e3a21c5f0c39 (patch) | |
tree | 3086d8a2bb98bcefc41d7fec9e88e6e68abe1c0d /symbol.c | |
parent | 390f087d871446b130ae3666620ccabb2e4e2ff8 (diff) |
symbol.c: more informative error message
* symbol.c (sym_check_asciionly): more informative error message
with the encoding name and the inspected content.
[ruby-core:73398] [Feature #12016]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'symbol.c')
-rw-r--r-- | symbol.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -430,7 +430,8 @@ sym_check_asciionly(VALUE str) if (!rb_enc_asciicompat(rb_enc_get(str))) return FALSE; switch (rb_enc_str_coderange(str)) { case ENC_CODERANGE_BROKEN: - rb_raise(rb_eEncodingError, "invalid encoding symbol"); + rb_raise(rb_eEncodingError, "invalid symbol in encoding %s :%+"PRIsVALUE, + rb_enc_name(rb_enc_get(str)), str); case ENC_CODERANGE_7BIT: return TRUE; } |