зеркало из https://github.com/github/ruby.git
dir.c: use built-in encoding indexes
* internal.h: add UTF8-MAC. * dir.c (rb_utf8mac_encoding): use built-in encoding indexes in internal.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
66564ab6b2
Коммит
14dfdb5eaf
|
@ -1,4 +1,9 @@
|
|||
Tue Jul 2 17:22:36 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
Tue Jul 2 17:22:40 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* internal.h: add UTF8-MAC.
|
||||
|
||||
* dir.c (rb_utf8mac_encoding): use built-in encoding indexes in
|
||||
internal.h.
|
||||
|
||||
* internal.h: add UTF-{16,32} dummy encodings.
|
||||
|
||||
|
|
4
dir.c
4
dir.c
|
@ -91,9 +91,7 @@ char *strchr(char*,char);
|
|||
rb_encoding *
|
||||
rb_utf8mac_encoding(void)
|
||||
{
|
||||
static rb_encoding *utf8mac;
|
||||
if (!utf8mac) utf8mac = rb_enc_find("UTF8-MAC");
|
||||
return utf8mac;
|
||||
return rb_enc_from_index(ENCINDEX_UTF8_MAC);
|
||||
}
|
||||
|
||||
static inline int
|
||||
|
|
|
@ -565,6 +565,7 @@ rb_enc_init(void)
|
|||
ENCDB_REGISTER("UTF-32LE", UTF_32LE);
|
||||
ENCDB_REGISTER("UTF-16", UTF_16);
|
||||
ENCDB_REGISTER("UTF-32", UTF_32);
|
||||
ENCDB_REGISTER("UTF8-MAC", UTF8_MAC);
|
||||
#undef ENCDB_REGISTER
|
||||
#endif
|
||||
enc_table.count = ENCINDEX_BUILTIN_MAX;
|
||||
|
|
|
@ -210,6 +210,7 @@ enum ruby_preserved_encindex {
|
|||
ENCINDEX_UTF_32LE,
|
||||
ENCINDEX_UTF_16,
|
||||
ENCINDEX_UTF_32,
|
||||
ENCINDEX_UTF8_MAC,
|
||||
#endif
|
||||
|
||||
ENCINDEX_BUILTIN_MAX
|
||||
|
|
Загрузка…
Ссылка в новой задаче