aboutsummaryrefslogtreecommitdiffstats
path: root/encoding.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-15 05:03:49 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-15 05:03:49 +0000
commit77ae7b2e8353c963404c31c6d910fe77286cbd81 (patch)
tree0cd1302738bdcd7844a8f467b9e40d4612e9f564 /encoding.c
parentde6d4226559bd2d4ff2ffd78cf1c0b03559630aa (diff)
downloadruby-77ae7b2e8353c963404c31c6d910fe77286cbd81.tar.gz
string.c: use actual encodings
* string.c (get_actual_encoding): get actual encoding according to the BOM if exists. * string.c (rb_str_inspect): use according encoding, instead of pseudo encodings, UTF-{16,32}. [ruby-core:59757] [Bug #8940] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'encoding.c')
-rw-r--r--encoding.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/encoding.c b/encoding.c
index ab03806dce..f102524379 100644
--- a/encoding.c
+++ b/encoding.c
@@ -598,6 +598,12 @@ rb_enc_from_index(int index)
return enc_table.list[index].enc;
}
+rb_encoding *
+rb_enc_get_from_index(int index)
+{
+ return must_encindex(index);
+}
+
int
rb_enc_registered(const char *name)
{