Loading Ruby.wasm runtime…
Reproduction script
require "json"
result = { ruby_version: RUBY_VERSION }
prefix = '\p{In_Arabic}'
suffix = '\p{In_Arabic}'.encode('US-ASCII')
begin
re = /#{prefix}#{suffix}/
result[:regexp_built] = true
result[:regexp_raised] = nil
rescue => e
result[:regexp_built] = false
result[:regexp_raised] = e.class.name
end
begin
s = "#{prefix}#{suffix}"
result[:string_built] = true
result[:string_encoding] = s.encoding.name
result[:string_raised] = nil
rescue => e
result[:string_built] = false
result[:string_encoding] = nil
result[:string_raised] = e.class.name
end
JSON.dump(result)
Output
(running)