diff options
Diffstat (limited to 'template')
-rw-r--r-- | template/prelude.c.tmpl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/template/prelude.c.tmpl b/template/prelude.c.tmpl index aa760dc054..99dc25fee8 100644 --- a/template/prelude.c.tmpl +++ b/template/prelude.c.tmpl @@ -45,6 +45,7 @@ class Prelude lines = [] result = [@preludes.size, @vpath.strip(filename), lines, sub] @vpath.foreach(filename) do |line| + line.force_encoding("ASCII-8BIT") if line.respond_to?(:force_encoding) @preludes[filename] ||= result comment = ($1 || '' if line.sub!(/(?:^|\s+)\#(?:$|[#\s](.*))/, '')) if line.size > LINE_LIMIT @@ -137,7 +138,7 @@ prelude_prefix_path(VALUE self) % unless preludes.empty? #define PRELUDE_NAME(n) rb_usascii_str_new_static(prelude_name##n, sizeof(prelude_name##n)-1) -#define PRELUDE_CODE(n) rb_usascii_str_new_static(prelude_code##n.L0, sizeof(prelude_code##n)) +#define PRELUDE_CODE(n) rb_utf8_str_new_static(prelude_code##n.L0, sizeof(prelude_code##n)) COMPILER_WARNING_PUSH #if GCC_VERSION_SINCE(4, 2, 0) COMPILER_WARNING_ERROR(-Wmissing-field-initializers) |