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.

utf8-unstable.diff

Alf Gaida, 2011-05-29 07:21 am

Download (1.9 kB)

 
b/app/models/changeset.rb
78 78
  end
79 79
  
80 80
  def before_create
81
    self.committer = self.class.to_utf8(self.committer, repository.repo_log_encoding)
81
    self.committer = self.class.to_utf8_for_repositories(self.committer, repository.repo_log_encoding)
82 82
    self.comments  = self.class.normalize_comments(self.comments, repository.repo_log_encoding)
83 83
    self.user = repository.find_committer_user(self.committer)
84 84
  end
......
237 237

  
238 238
  # Strips and reencodes a commit log before insertion into the database
239 239
  def self.normalize_comments(str, encoding)
240
    Changeset.to_utf8(str.to_s.strip, encoding)
240
    Changeset.to_utf8_for_repositories(str.to_s.strip, encoding)
241 241
  end
242 242

  
243 243
  private
b/app/views/common/_diff.rhtml
5 5
<% if diff.diff_type == 'sbs' -%>
6 6
<table class="filecontent">
7 7
<thead>
8
<tr><th colspan="4" class="filename"><%=to_utf8 table_file.file_name %></th></tr>
8
<tr><th colspan="4" class="filename"><%=to_utf8_for_attachments table_file.file_name %></th></tr>
9 9
</thead>
10 10
<tbody>
11 11
<% table_file.each_line do |spacing, line| -%>
......
17 17
<tr>
18 18
  <th class="line-num"><%= line.nb_line_left %></th>
19 19
  <td class="line-code <%= line.type_diff_left %>">
20
    <pre><%=to_utf8 line.html_line_left %></pre>
20
    <pre><%=to_utf8_for_attachments line.html_line_left %></pre>
21 21
  </td>
22 22
  <th class="line-num"><%= line.nb_line_right %></th>
23 23
  <td class="line-code <%= line.type_diff_right %>">
24
    <pre><%=to_utf8 line.html_line_right %></pre>
24
    <pre><%=to_utf8_for_attachments line.html_line_right %></pre>
25 25
  </td>
26 26
</tr>
27 27
<% end -%>