Feature #12034 » 0001-string.c-rb_external_str_with_enc-fall-back-to-ASCII.patch
string.c | ||
---|---|---|
return str;
|
||
}
|
||
rb_enc_associate_index(str, eidx);
|
||
if (rb_enc_str_coderange(str) == ENC_CODERANGE_BROKEN) {
|
||
rb_enc_associate_index(str, rb_ascii8bit_encindex());
|
||
return str;
|
||
}
|
||
return rb_str_conv_enc(str, eenc, rb_default_internal_encoding());
|
||
}
|
||
test/ruby/test_dir_m17n.rb | ||
---|---|---|
opts = {:encoding => Encoding.default_external} if /mswin|mingw/ =~ RUBY_PLATFORM
|
||
ents = Dir.entries(".", opts)
|
||
filename = "%FF" if /darwin/ =~ RUBY_PLATFORM && ents.include?("%FF")
|
||
assert_include(ents, filename)
|
||
assert_include(ents, filename.b)
|
||
ents.each { |f| assert_predicate f, :valid_encoding? }
|
||
EOS
|
||
}
|
||
end unless /mswin|mingw/ =~ RUBY_PLATFORM
|