summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y4
1 files changed, 2 insertions, 2 deletions
diff --git a/parse.y b/parse.y
index ae48d383c8..b0da1b7cb6 100644
--- a/parse.y
+++ b/parse.y
@@ -5153,7 +5153,7 @@ debug_lines(const char *f)
if (rb_const_defined_at(rb_cObject, script_lines)) {
VALUE hash = rb_const_get_at(rb_cObject, script_lines);
if (TYPE(hash) == T_HASH) {
- VALUE fname = rb_str_new2(f);
+ VALUE fname = rb_external_str_new_with_enc(f, strlen(f), rb_filesystem_encoding());
VALUE lines = rb_ary_new();
rb_hash_aset(hash, fname, lines);
return lines;
@@ -5167,7 +5167,7 @@ coverage(const char *f, int n)
{
VALUE coverages = rb_get_coverages();
if (RTEST(coverages) && RBASIC(coverages)->klass == 0) {
- VALUE fname = rb_str_new2(f);
+ VALUE fname = rb_external_str_new_with_enc(f, strlen(f), rb_filesystem_encoding());
VALUE lines = rb_ary_new2(n);
int i;
RBASIC(lines)->klass = 0;