Defect #120
closedTitle with non-ascii characters breaks wiki
0%
Description
I have tried to create new page named "テスト" (means "test" in Japanese). But titleize method
in wiki.rb returns "テ\203\206スト". "\203\206" is garbage and makes wrong link URL wiki output.
Processing WikiController#index (for 192.168.1.254 at 2007-10-06 00:04:29) [GET]
Session ID: a27d3282becffb7500d5f3f0d16ff918
Parameters: {"action"=>"index", "id"=>"5",
"controller"=>"wiki", "page"=>"テ\203\206スト"}
The patch below addresses this problem.
Index: app/models/wiki.rb
===================================================================
--- app/models/wiki.rb (revision 802)
+++ app/models/wiki.rb (working copy)@ -48,7 +48,7
@
# replace spaces with _ and remove unwanted caracters
title = title.gsub(/\s+/, '_').delete(',./?;|:') if title
# upcase the first letter
- title = (title.length > 1 ? title.first.upcase + title[1..-1] : title.upcase) if title
+ title = title.capitalize if title
title
end
end