Remove get_actual_encoding() and the dynamic endian detection for dummy UTF-16/UTF-32

* And simplify callers of get_actual_encoding().
* See [Feature #18949].
* See https://github.com/ruby/ruby/pull/6322#issuecomment-1242758474
This commit is contained in:
Benoit Daloze 2022-09-10 19:15:49 +02:00
parent ed029e9bd4
commit 6525b6f760
7 changed files with 26 additions and 101 deletions

View file

@ -17,7 +17,7 @@
#define ENC_DEFINE(name) rb_encdb_declare(name)
#define ENC_SET_BASE(name, orig) rb_enc_set_base((name), (orig))
#define ENC_SET_DUMMY(name, orig) rb_enc_set_dummy(name)
#define ENC_DUMMY_UNICODE(name) rb_encdb_set_unicode(rb_enc_set_dummy(ENC_REPLICATE((name), name "BE")))
#define ENC_DUMMY_UNICODE(name) ENC_DUMMY(name)
void
Init_encdb(void)

View file

@ -1,5 +1,5 @@
#include "regenc.h"
/* dummy for unsupported, stateful encoding */
#define ENC_DUMMY_UNICODE(name) ENC_REPLICATE(name, name "BE")
#define ENC_DUMMY_UNICODE(name) ENC_DUMMY(name)
ENC_DUMMY_UNICODE("UTF-16");
ENC_DUMMY_UNICODE("UTF-32");