summaryrefslogtreecommitdiffstats
path: root/encoding.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-26 09:39:08 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-26 09:39:08 +0000
commit05253b86cbd7ab1c7cd57203c39a8c4c1e07c8f4 (patch)
tree3ab3cc624ac5e26788e772517645bb312837e1c8 /encoding.c
parent3cc595484341c7510fbca8e0e01315727714492f (diff)
downloadruby-05253b86cbd7ab1c7cd57203c39a8c4c1e07c8f4.tar.gz
ruby-05253b86cbd7ab1c7cd57203c39a8c4c1e07c8f4.tar.xz
ruby-05253b86cbd7ab1c7cd57203c39a8c4c1e07c8f4.zip
* encoding.c (rb_enc_check): check for ASCII-compatibilities.
* parse.y (parser_tokadd_string, parser_parse_string, parser_here_document, parser_yylex): set encoding to US-ASCII. * parse.y (rb_enc_symname_p): check if valid with encoding. * parse.y (rb_intern3): let symbols have encoding. * string.c (rb_str_hash): add encoding index. * string.c (rb_str_comparable, rb_str_equal, rb_str_eql): check if compatible encoding. * string.c (sym_inspect): made encoding aware. * insns.def (opt_eq): compare with encoding. * include/ruby/encoding.h (rb_enc_asciicompat): check if ASCII compatible. * include/ruby/encoding.h (rb_enc_get_index): added prototype. * include/ruby/intern.h (rb_str_comparable, rb_str_equal): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'encoding.c')
-rw-r--r--encoding.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/encoding.c b/encoding.c
index b1c8ba934..a6ee890ce 100644
--- a/encoding.c
+++ b/encoding.c
@@ -194,19 +194,15 @@ rb_enc_check(VALUE str1, VALUE str2)
if (idx1 == 0) {
enc = rb_enc_from_index(idx2);
-#if 0
- if (m17n_asciicompat(enc)) {
+ if (rb_enc_asciicompat(enc)) {
return enc;
}
-#endif
}
else if (idx2 == 0) {
enc = rb_enc_from_index(idx1);
-#if 0
- if (m17n_asciicompat(enc)) {
+ if (rb_enc_asciicompat(enc)) {
return enc;
}
-#endif
}
rb_raise(rb_eArgError, "character encodings differ");
}