mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
encoding.c: unicode_p
* enc/encdb.c, enc/utf_16_32.h (ENC_DUMMY_UNICODE): endian-less wide UTF encodings are dummy but Unicode. * encoding.c (rb_encdb_set_unicode): set Unicode flag. * template/encdb.h.tmpl: allow ENC_DUMMY variants. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5d316e7786
commit
928d1a5261
5 changed files with 24 additions and 3 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
|||
Sat Oct 6 09:42:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* enc/encdb.c, enc/utf_16_32.h (ENC_DUMMY_UNICODE): endian-less wide
|
||||
UTF encodings are dummy but Unicode.
|
||||
|
||||
* encoding.c (rb_encdb_set_unicode): set Unicode flag.
|
||||
|
||||
* template/encdb.h.tmpl: allow ENC_DUMMY variants.
|
||||
|
||||
* encoding.c (rb_enc_unicode_p): oniguruma provides Unicode flag.
|
||||
|
||||
Fri Oct 5 17:18:42 JST 2012 TAKANO Mitsuhiro <tak@no32.tk>
|
||||
|
||||
* template/Doxyfile.tmpl: remove SHOW_DIRECTORIES and
|
||||
|
|
|
@ -14,11 +14,13 @@ int rb_encdb_alias(const char *alias, const char *orig);
|
|||
int rb_encdb_dummy(const char *name);
|
||||
void rb_encdb_declare(const char *name);
|
||||
void rb_enc_set_base(const char *name, const char *orig);
|
||||
void rb_encdb_set_unicode(int index);
|
||||
#define ENC_REPLICATE(name, orig) rb_encdb_replicate((name), (orig))
|
||||
#define ENC_ALIAS(name, orig) rb_encdb_alias((name), (orig))
|
||||
#define ENC_DUMMY(name) rb_encdb_dummy(name)
|
||||
#define ENC_DEFINE(name) rb_encdb_declare(name)
|
||||
#define ENC_SET_BASE(name, orig) rb_enc_set_base((name), (orig))
|
||||
#define ENC_DUMMY_UNICODE(name) rb_encdb_set_unicode(ENC_DUMMY(name))
|
||||
|
||||
void
|
||||
Init_encdb(void)
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "regenc.h"
|
||||
/* dummy for unsupported, statefull encoding */
|
||||
ENC_DUMMY("UTF-16");
|
||||
ENC_DUMMY("UTF-32");
|
||||
#define ENC_DUMMY_UNICODE(name) ENC_DUMMY(name)
|
||||
ENC_DUMMY_UNICODE("UTF-16");
|
||||
ENC_DUMMY_UNICODE("UTF-32");
|
||||
|
|
|
@ -32,6 +32,7 @@ void rb_encdb_declare(const char *name);
|
|||
int rb_encdb_replicate(const char *name, const char *orig);
|
||||
int rb_encdb_dummy(const char *name);
|
||||
int rb_encdb_alias(const char *alias, const char *orig);
|
||||
void rb_encdb_set_unicode(int index);
|
||||
#pragma GCC visibility pop
|
||||
#endif
|
||||
|
||||
|
@ -512,6 +513,12 @@ rb_encdb_alias(const char *alias, const char *orig)
|
|||
return enc_alias(alias, idx);
|
||||
}
|
||||
|
||||
void
|
||||
rb_encdb_set_unicode(int index)
|
||||
{
|
||||
rb_enc_from_index(index)->flags |= ONIGENC_FLAG_UNICODE;
|
||||
}
|
||||
|
||||
enum {
|
||||
ENCINDEX_ASCII,
|
||||
ENCINDEX_UTF_8,
|
||||
|
|
|
@ -61,7 +61,7 @@ encdirs.each do |encdir|
|
|||
raise ArgumentError,
|
||||
'%s:%d: ENC_ALIAS: %s is not defined yet. (alias %s)' %
|
||||
[fn, $., $2, $1] unless defs[$2.upcase]
|
||||
when /^ENC_DUMMY\(\s*"([^"]+)"/
|
||||
when /^ENC_DUMMY\w*\(\s*"([^"]+)"/
|
||||
count += 1
|
||||
else
|
||||
next
|
||||
|
|
Loading…
Reference in a new issue