(and garbled characters without cache)
Demo application: https://github.com/edogawaconan/testutf8
(pardon the gemfile requirements)
Start rails and visit /test.atom to reproduce the error. Also additionally visit /test2.atom to see how the character becomes garbled without cache.
### assuming rbx with RBXOPT=-X19
### with nodejs' node somewhere in PATH
git clone https://github.com/edogawaconan/testutf8
rbx -S gem install bundler
rbx -S bundle install
rbx -S bundle exec rails s
### and then open/curl the aforementioned url - http://localhost:3000/test.atom etc
Notice that same variable rendered properly in html (/test.html).
No actual memcached server is required.
The following code is what the cache executes
# encoding: utf-8
s = '<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
<link rel="alternate" type="text/html" href="http://zero-knowledge.org:3000/"/>
<link rel="self" type="application/atom+xml" href="http://zero-knowledge.org:3000/test.atom"/>
f = s.slice!(0..-1)
The line causing the slice! is in actionpack. As it is building a Range there, I can't introduce nil as that would break.
The method missing error was fixed with 9653426, but the underlying string corruption still needs to be fixed.
The problem is that String#tr isn't encoding aware yet and replaces strings wrong.
Closing this one since the remaining problem of the invalid character is in issue #2157