diff options
| author | Max Prokopiev <maxprokopiev@github.com> | 2024-01-24 20:36:37 +0100 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2024-01-24 20:32:01 +0000 |
| commit | 91a5093c15f5fe5e51f0f5ba3183ea44688b49ea (patch) | |
| tree | 1d366bc4b67e4830a43d23d7b013098c3df7ff33 /prism | |
| parent | 6a63aaade9cf08e51920698372e8973f1580d8d7 (diff) | |
[ruby/prism] Force encoding during deserialization of constants
otherwise we get failing tests if we have non-ascii
characters in fixtures/**/*.txt
https://github.com/ruby/prism/commit/9323243569
Diffstat (limited to 'prism')
| -rw-r--r-- | prism/templates/lib/prism/serialize.rb.erb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/prism/templates/lib/prism/serialize.rb.erb b/prism/templates/lib/prism/serialize.rb.erb index 7cbbfb63c5..0b5300c4c5 100644 --- a/prism/templates/lib/prism/serialize.rb.erb +++ b/prism/templates/lib/prism/serialize.rb.erb @@ -211,9 +211,9 @@ module Prism constant = if start.nobits?(1 << 31) - input.byteslice(start, length).to_sym + input.byteslice(start, length).force_encoding(@encoding).to_sym else - serialized.byteslice(start & ((1 << 31) - 1), length).to_sym + serialized.byteslice(start & ((1 << 31) - 1), length).force_encoding(@encoding).to_sym end constant_pool[index] = constant |
