From 42a2f89b3918cbe352528a0addc5ec59dfe2ad83 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 2 Jul 2013 08:22:34 +0000 Subject: io.c: use built-in encoding indexes * internal.h: add UTF-{16,32}{BE,LE}. * io.c (io_strip_bom): use built-in encoding indexes in internal.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- encoding.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'encoding.c') diff --git a/encoding.c b/encoding.c index d83fc2d002..98cecaec0a 100644 --- a/encoding.c +++ b/encoding.c @@ -559,6 +559,10 @@ rb_enc_init(void) #undef ENC_REGISTER #ifndef NO_PRESERVED_ENCODING #define ENCDB_REGISTER(name, enc) enc_register_at(ENCINDEX_##enc, name, NULL) + ENCDB_REGISTER("UTF-16BE", UTF_16BE); + ENCDB_REGISTER("UTF-16LE", UTF_16LE); + ENCDB_REGISTER("UTF-32BE", UTF_32BE); + ENCDB_REGISTER("UTF-32LE", UTF_32LE); #undef ENCDB_REGISTER #endif enc_table.count = ENCINDEX_BUILTIN_MAX; -- cgit v1.2.1