Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Prevent using String#scrub on Rubinius

Rubinius' has built-in support for String#scrub but it doesn't have yet
support for ASCII-incompatible chars so for now, we should rely on the
old implementation of #tidy_bytes.
  • Loading branch information...
commit 29e895770bc341ae8b8fa035f36c24367eeb5e37 1 parent 4efb36e
@robin850 robin850 authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  activesupport/lib/active_support/multibyte/unicode.rb
3  activesupport/lib/active_support/multibyte/unicode.rb
@@ -213,7 +213,8 @@ def compose(codepoints)
# Ruby >= 2.1 has String#scrub, which is faster than the workaround used for < 2.1.
- if '<3'.respond_to?(:scrub)
+ # Rubinius' String#scrub, however, doesn't support ASCII-incompatible chars.
+ if '<3'.respond_to?(:scrub) && !defined?(Rubinius)
# Replaces all ISO-8859-1 or CP1252 characters by their UTF-8 equivalent
# resulting in a valid UTF-8 string.
Please sign in to comment.
Something went wrong with that request. Please try again.