Closed asiyanko closed 12 years ago
Hmmm... would this Redmine::CodesetUtil.to_utf8_by_setting
command work in the earlier versions of redmine (1.0, 0.8, etc.)?
No this will not work in earlier versions, even 1.2. Look at changesets 7871, 7828, 7825, 7818, 7810 for details. Unfortunately I don't have much expertise in Ruby neither I have deep knowledge of Redmine sources, since I'm just an ordinary Redmine user. I've just tracked code changes, when I found out, that the plugin doesn't work any more after I upgraded from 1.2.1 to 1.3.0. So I've just suggested a quick fix.
Oh! According to these changelogs, to_utf8
is just calling Redmine::CodesetUtil.to_utf8_by_setting(str)
. That should mean that this method works in versions 1.0 and 0.8 as well. I'll look into this.
yes, it looks like this according to changeset 7825, but then in 7871 they just got rid of to_utf8() method in all helpers so there is no such method with one parameter anymore. Instead, to_utf8() in codeset_util.rb has 2 parameters - 'str' and 'encoding'.
Okay, so I committed this fix. I hope it doesn't break anything -- I don't have a redmine install to test on. :(
It turned out that plugin doesn't work with Redmine 1.3.0. An attempt to view a file displays internal server error and logs the following message:
To fix this all 'to_utf8' calls in rhtml-files under app/views directory should be changed to 'Redmine::CodesetUtil.to_utf8_by_setting'