Skip to content

Instantly share code, notes, and snippets.

@joho
Created February 15, 2012 22:15
Show Gist options
  • Save joho/1839404 to your computer and use it in GitHub Desktop.
Save joho/1839404 to your computer and use it in GitHub Desktop.
My foolproof upgrade path from ruby 1.8 to 1.9
ObjectSpace.each_object do |object|
object.force_encoding("utf-8") if object.respond_to?(:force_encoding)
end
@chendo
Copy link

chendo commented Feb 15, 2012

So... in a before_filter, right?

@joho
Copy link
Author

joho commented Feb 15, 2012

At the very least. Maybe in an after_filter too. and called liberally in the middle of requests too.

@chendo
Copy link

chendo commented Feb 15, 2012

I don't foresee any performance implications at all from this.

@yob
Copy link

yob commented Feb 15, 2012

sweet jesus, good luck with that

@joho
Copy link
Author

joho commented Feb 15, 2012

:trollface:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment