diff --git a/app/controllers/admin/shipments_controller_decorator.rb b/app/controllers/admin/shipments_controller_decorator.rb index 8f863ec..7609ec1 100644 --- a/app/controllers/admin/shipments_controller_decorator.rb +++ b/app/controllers/admin/shipments_controller_decorator.rb @@ -2,10 +2,15 @@ Admin::ShipmentsController.class_eval do def dhllabel load_shipment name = '%s_dhllabel.csv' % [@order.number] - headers["Content-type"] = "text/plain" + headers["Content-type"] = "text/plain; charset=iso-8859-15" headers["Cache-Control"] = "no-cache, max-age=0, must-revalidate" headers["Pragma"] = "no-cache" headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT" headers["Content-Disposition"] = "attachment; filename=\"%s\"" % name + + # Try hard to render it as latin1 + res = render + response.charset = 'iso-8859-15' + response.body = Iconv.conv('iso-8859-15', 'utf-8', res) end end