Skip to content

Instantly share code, notes, and snippets.

@subelsky
Created June 11, 2009 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save subelsky/128258 to your computer and use it in GitHub Desktop.
Save subelsky/128258 to your computer and use it in GitHub Desktop.
begin
text = JSON.generate(refresh_hash)
render :text => Iconv.iconv('utf-8','latin1',text).to_s
rescue StandardError
logger.warn("JSON generation error in refresh controller: #{$!}")
render :text => "Problem reading messages, please try again", :status => 500
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment