Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- File.open( "#{ Rails.root }/tmp/#{ id }", 'w:iso-8859-15:iso-8859-15' ) { |f| f << Model.info_in_iso-8859-15 }
- respond_to do |format|
- format.text { send_file( route, filename: 'info', type: 'text/plain; charset=iso-8859-15; header=present' ) }
- end
- def normalize_to_iso8859( string )
- if string and string.class == String
- string.gsub(/[u201cu201d]/, '"').gsub(/[u2013]/, '-').encode( "ISO8859-15" )
- else
- string
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement