Patch #6416

When viewing utf-8 text file in repository, it is downloaded

Added by Masahiro Tomita about 7 years ago. Updated over 6 years ago.

Status:ClosedStart date:2010-09-16
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:SCM
Target version:-

Description

I want to view the utf-8 text file in repository, but it is downloaded.

In RepositoriesController#entry(), String#is_binary_data? is used to determine the file is binary or not.
But String#is_binary_data? return true even if the file is utf-8 text.

I wrote a patch to fix this problem.

repositories_controller.patch Magnifier (1.13 KB) Masahiro Tomita, 2010-09-16 17:37


Related issues

Related to Redmine - Defect #6256: Redmine considers non ASCII and UTF-16 text files as bina... Closed 2010-08-31

History

#1 Updated by Yar Isakov almost 7 years ago

I want to confirm this bug. Some files in utf-8 encoding are downloading instead of showing.

#2 Updated by Toshi MARUYAMA almost 7 years ago

  • Category set to SCM

#3 Updated by Toshi MARUYAMA over 6 years ago

  • Status changed from New to 7
  • Assignee set to Toshi MARUYAMA

#4 Updated by Toshi MARUYAMA over 6 years ago

  • Status changed from 7 to Closed
  • Assignee deleted (Toshi MARUYAMA)

I confirmed source:trunk/config/locales/ja.yml is as binary.
repositories_controller.patch is only for UTF-8.
Redmine supports multi encoding.
For example, ISO-8859-1, Japanese Shift_JIS, EUC-JP...
Iconv passes converting from ISO-8859-1 to UTF-8 with no error.

I will fix #6256 in another way.

Also available in: Atom PDF