ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

Japanese attachement filename is broken on Japanese Windows Ruby 1.9 (Bug #856)


Added by Toshi MARUYAMA at 2012-02-01 03:16 pm. Updated at 2012-12-11 08:08 am.


Status:Open Start date:2012-02-02
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:-
Target version:-
Remote issue URL: Affected version:2.6.0

Description

$ ruby --version
ruby 1.9.3p0 (2011-10-30) [i386-mingw32]

ChiliProject 2.6 Ruby 1.9.3

Redmine Rails 3.1.3 Ruby 1.9.3


chili-2.6.png (25.9 kB) Toshi MARUYAMA, 2012-02-01 03:16 pm

redmine-rails-3.1.3-ruby-1.9.3.png (26.4 kB) Toshi MARUYAMA, 2012-02-01 03:16 pm

日本語-Japanese.txt (285 Bytes) Toshi MARUYAMA, 2012-02-01 03:16 pm


History

Updated by Toshi MARUYAMA at 2012-02-01 03:23 pm

Sorry, subject "attachement" is typo.

Updated by Pavel Nakonechny at 2012-02-14 07:12 am

In

app/models/attachment.rb

replace

@filename = just_filename.gsub(/[^\w\.\-]/,'_')

with
@filename = just_filename.gsub(/[\/\?\%\*\:\|\"\'<>]+/, '_')

Updated by Toshi MARUYAMA at 2012-03-17 02:48 am

It seems following lines fix this problem.

1      if o.respond_to?(:original_filename)
2        o.original_filename.force_encoding(Encoding::UTF_8)
3        raise ActionController::InvalidByteSequenceErrorFromParams unless o.original_filename.valid_encoding?
4      end

This code is from http://developer.uservoice.com/entries/how-to-upgrade-a-rails-2.3.14-app-to-ruby-1.9.3/

Updated by rwing rwing at 2012-12-11 08:08 am

Toshi MARUYAMA wrote:

It seems following lines fix this problem.

[...]

This code is from http://developer.uservoice.com/entries/how-to-upgrade-a-rails-2.3.14-app-to-ruby-1.9.3/

Sorry, I'm ruby newbie, which file I need to modify?

Also available in: Atom PDF