diff options
author | S-H-GAMELINKS <[email protected]> | 2022-05-01 23:13:59 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2022-06-17 12:02:50 +0900 |
commit | 420f3ced4d25c0e81d06f3186c8cfdc509326268 (patch) | |
tree | 273755e3b753cd5aed06f786947cd7dcc2f223f5 /file.c | |
parent | 51a3ebf4ec6182ee516992dc761950d19a7b697b (diff) |
Using is_ascii_string to check encoding
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5867
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -4001,7 +4001,7 @@ rb_file_expand_path_internal(VALUE fname, VALUE dname, int abs_mode, int long_na rb_str_set_len(result, p - buf + strlen(p)); encidx = ENCODING_GET(result); tmp = result; - if (encidx != ENCINDEX_UTF_8 && rb_enc_str_coderange(result) != ENC_CODERANGE_7BIT) { + if (encidx != ENCINDEX_UTF_8 && !is_ascii_string(result)) { tmp = rb_str_encode_ospath(result); } len = MultiByteToWideChar(CP_UTF8, 0, RSTRING_PTR(tmp), -1, NULL, 0); |