Project

General

Profile

Actions

Defect #21656

closed

Fix Non ASCII attachment filename encoding broken (MOJIBAKE) in Microsoft Edge Explorer

Added by Hang Xie almost 9 years ago. Updated almost 9 years ago.

Status:
Closed
Priority:
Normal
Category:
Attachments
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

Microsoft Edge Explorer Change its User-Agent to this:

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586

It makes redmine can not detect correctly, and it is easy to fix:
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 98a2246..1fae635 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -595,7 +595,7 @@ class ApplicationController < ActionController::Base

   # Returns a string that can be used as filename value in Content-Disposition header
   def filename_for_content_disposition(name)
-    request.env['HTTP_USER_AGENT'] =~ %r{(MSIE|Trident)} ? ERB::Util.url_encode(name) : name
+    request.env['HTTP_USER_AGENT'] =~ %r{(MSIE|Trident|Edge)} ? ERB::Util.url_encode(name) : name
   end

   def api_request?


Related issues

Related to Redmine - Defect #16711: Non-ascii attachment file name get corrupted in IE11 Closed

Actions
Actions #1

Updated by Go MAEDA almost 9 years ago

  • Related to Defect #16711: Non-ascii attachment file name get corrupted in IE11 added
Actions #2

Updated by Go MAEDA almost 9 years ago

  • Category set to Attachments
  • Target version set to 2.6.10
Actions #3

Updated by Jean-Philippe Lang almost 9 years ago

  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed
Actions

Also available in: Atom PDF