File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -1650,6 +1650,16 @@ rb_enc_aliases(VALUE klass)
16501650 return aliases [0 ];
16511651}
16521652
1653+ static VALUE
1654+ encoding_compatibility_p ()
1655+ {
1656+ if (rb_encoding_compat ) {
1657+ return Qtrue ;
1658+ } else {
1659+ return Qfalse ;
1660+ }
1661+ }
1662+
16531663/*
16541664 * An Encoding instance represents a character encoding usable in Ruby. It is
16551665 * defined as a constant under the Encoding namespace. It has a name and
@@ -1873,6 +1883,7 @@ Init_Encoding(void)
18731883 rb_define_singleton_method (rb_cEncoding , "aliases" , rb_enc_aliases , 0 );
18741884 rb_define_singleton_method (rb_cEncoding , "find" , enc_find , 1 );
18751885 rb_define_singleton_method (rb_cEncoding , "compatible?" , enc_compatible_p , 2 );
1886+ rb_define_singleton_method (rb_cEncoding , "compatibility?" , encoding_compatibility_p , 0 );
18761887
18771888 rb_define_method (rb_cEncoding , "_dump" , enc_dump , -1 );
18781889 rb_define_singleton_method (rb_cEncoding , "_load" , enc_load , 1 );
You can’t perform that action at this time.
0 commit comments