Skip to content

Commit

Permalink
Consider valid encoding if a String passes ascii_only_p()
Browse files Browse the repository at this point in the history
Related to #3531
  • Loading branch information
ahmadsherif committed Feb 17, 2016
1 parent db6c098 commit 431e258
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vm/builtin/string.cpp
Expand Up @@ -1891,7 +1891,7 @@ namespace rubinius {

Object* String::valid_encoding_p(STATE) {
if(valid_encoding_->nil_p()) {
if(encoding(state) == Encoding::ascii8bit_encoding(state)) {
if(encoding(state) == Encoding::ascii8bit_encoding(state) || CBOOL(ascii_only_p(state))) {
valid_encoding(state, cTrue);
return valid_encoding_;
}
Expand Down

0 comments on commit 431e258

Please sign in to comment.