rails/rails — pull request #13843 by misfo (2014-01-25 22:01:15+00:00)
Title: Tokenizer's constructor shouldn't modify it's argument

The string that was passed in was getting re-encoded in-place:

```ruby
Encoding.default_internal = 'UTF-8'
enye = "\xF1".force_encoding('ISO-8859-1')
puts enye.encoding #=> ISO-8859-1
HTML::Tokenizer.new(enye)
puts enye.encoding #=> UTF-8
# Oh no! Who re-encoded my enye in-place?!?
```

I found this after the `strip_tags` helper was giving me a `cannot modify frozen string` error, which raised the question: why is it modifying my string anyways?