Skip to content

Instantly share code, notes, and snippets.

View michaeleconomy's full-sized avatar

Michael Economy michaeleconomy

View GitHub Profile
@michaeleconomy
michaeleconomy / gist:3796400
Created September 27, 2012 20:53
Fix for ascii-8bit chars making it in as keys in params
module ActionDispatch
module Http
module Parameters
private
def encode_params(params)
return params unless "ruby".encoding_aware?
if params.is_a?(String)
return params.force_encoding("UTF-8").encode!
elsif !params.is_a?(Hash)
return params
4 Temple of Plenty
4 Temple of Abandon
8 Forest
4 Temple of Mystery
4 Hero of Leina Tower
2 Centaur Battlemaster
2 Voyaging Satyr