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.
Non-latin anchors doesn't work in wiki (Bug #972)
Description
I create wiki-page with content:
h2. Принтеры h2. Printers
This is rendered as:
1<a name=""></a>
2<h2>Принтеры<a href="#" class="wiki-anchor">¶</a></h2>
3
4<a name="Printers"></a>
5<h2>Printers<a href="#Printers" class="wiki-anchor">¶</a></h2>
Archor for russian header is empty.
Associated revisions
Add predefined date ranges to the time report in the same way as the details view (closes #972). It nows defaults to 'All time'.
This patch also fixes time report periods (columns) computation.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1318 e93f8b46-1217-0410-a6f0-8f06a7374b81
History
Updated by Ilya Turkin at 2012-05-15 08:21 am
The problem is the following: ApplicationHelper#parse_headings parse the strings with \w metacharacter: anchor = item.gsub(%r{[^\w\s\-]}, '').gsub(%r{\s+(\-+\s*)?}, '-')
.
AFAIK after ruby 1.9.1p378 \w is ASCII, so to correct the work with non-latin characters you need to substitute \w with \p{Word}.
Updated by Felix Schäfer at 2012-05-17 08:10 pm
Can anyone confirm this is a problem on 1.9 but not on 1.8?
Updated by Ilya Turkin at 2012-05-22 09:39 am
1ilya@ubuntu:~$ cd chiliproject/ 2ilya@ubuntu:~/chiliproject$ rvm use 1.8.7 3Using /home/ilya/.rvm/gems/ruby-1.8.7-p358 4ilya@ubuntu:~/chiliproject$ bundle exec script/console 5Loading development environment (Rails 2.3.14) 6NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01. 7Gem.source_index called from /home/ilya/.rvm/gems/ruby-1.8.7-p358/gems/rails-2.3.14/lib/rails/gem_dependency.rb:21. 8>> a = "чилипроджект" 9=> "чилипроджект" 10>> a.gsub(/\w/, '') 11=> "" 12>> exit 13ilya@ubuntu:~/chiliproject$ rvm use 1.9.2 14Using /home/ilya/.rvm/gems/ruby-1.9.2-p320 15ilya@ubuntu:~/chiliproject$ bundle exec script/console 16Loading development environment (Rails 2.3.14) 17NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01. 18Gem.source_index called from /home/ilya/.rvm/gems/ruby-1.9.2-p320/gems/rails-2.3.14/lib/rails/gem_dependency.rb:21. 19>> a = "чилипроджект" 20=> "чилипроджект" 21>> a.gsub(/\w/, '') 22=> "чилипроджект" 23>> a.gsub(/\p{Word}/, '') 24=> ""
- Assignee set to Felix Schäfer
Updated by Holger Just at 2012-05-22 10:44 am
The following patch solves the issue:
1diff --git a/config/environment.rb b/config/environment.rb
2index 84d6d1f..600597c 100644
3--- a/config/environment.rb
4+++ b/config/environment.rb
5@@ -24,9 +24,12 @@ ENV['RAILS_ENV'] ||= ENV['RACK_ENV'] if ENV['RACK_ENV']
6 # Specifies gem version of Rails to use when vendor/rails is not present
7 RAILS_GEM_VERSION = '2.3.14' unless defined? RAILS_GEM_VERSION
8
9+# this is replaced by config.encoding = "utf-8" in rails3
10 if RUBY_VERSION >= '1.9'
11 Encoding.default_external = 'UTF-8'
12 Encoding.default_internal = 'UTF-8'
13+else
14+ $KCODE='UTF-8'
15 end
16
17 # Bootstrap the Rails environment, frameworks, and default configuration
Two minor potential issues:
- unicode stuff might be invalid in anchors
- It might break other regexes relying on
\w
being only[a-zA-Z0-9_]
Updated by Ilya Turkin at 2012-05-23 06:01 am
Holger Just wrote:
The following patch solves the issue:
Sorry, but this is not the solution because the problem not with 1.8 but 1.9.