Project

General

Profile

Actions

Defect #120

closed

Title with non-ascii characters breaks wiki

Added by Go MAEDA over 16 years ago. Updated over 16 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

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

Actions #1

Updated by Jean-Philippe Lang over 16 years ago

Fixed committed in r805.

I used a slightly different solution since I don't want the end
of the title to be downcased (String#capitalize converts the
first character to uppercase and the remainder to lowercase).

Actions #2

Updated by Go MAEDA over 16 years ago

It works fine. Thanks.

Actions

Also available in: Atom PDF