mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Add Encoding::UNICODE_VERSION constant
This commit is contained in:
parent
5f3fb35a14
commit
b4417ff665
Notes:
git
2025-04-23 05:14:50 +00:00
3 changed files with 12 additions and 2 deletions
|
@ -801,7 +801,6 @@ SpecialsCopy:
|
|||
return (int )(to - to_start);
|
||||
}
|
||||
|
||||
#if 0
|
||||
const char onigenc_unicode_version_string[] =
|
||||
#ifdef ONIG_UNICODE_VERSION_STRING
|
||||
ONIG_UNICODE_VERSION_STRING
|
||||
|
@ -817,4 +816,3 @@ const int onigenc_unicode_version_number[3] = {
|
|||
0
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
|
|
11
encoding.c
11
encoding.c
|
@ -1953,6 +1953,17 @@ Init_Encoding(void)
|
|||
rb_marshal_define_compat(rb_cEncoding, Qnil, 0, enc_m_loader);
|
||||
}
|
||||
|
||||
void
|
||||
Init_unicode_version(void)
|
||||
{
|
||||
extern const char onigenc_unicode_version_string[];
|
||||
|
||||
VALUE str = rb_usascii_str_new_static(onigenc_unicode_version_string,
|
||||
strlen(onigenc_unicode_version_string));
|
||||
OBJ_FREEZE(str);
|
||||
rb_define_const(rb_cEncoding, "UNICODE_VERSION", str);
|
||||
}
|
||||
|
||||
void
|
||||
Init_encodings(void)
|
||||
{
|
||||
|
|
1
inits.c
1
inits.c
|
@ -75,6 +75,7 @@ rb_call_inits(void)
|
|||
CALL(ast);
|
||||
CALL(shape);
|
||||
CALL(Prism);
|
||||
CALL(unicode_version);
|
||||
|
||||
// enable builtin loading
|
||||
CALL(builtin);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue