From 85e050f0ee275938e7640244b2ea33c76e0c0aba Mon Sep 17 00:00:00 2001 From: KUBO Atsuhiro Date: Tue, 1 Sep 2009 18:50:56 +0900 Subject: [PATCH] added multibyte support for the subject of a issue by removing invalid UTF-8 characters. --- app/views/todos/_new_todo.html.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/todos/_new_todo.html.erb b/app/views/todos/_new_todo.html.erb index 4c23f35..b50f655 100644 --- a/app/views/todos/_new_todo.html.erb +++ b/app/views/todos/_new_todo.html.erb @@ -39,7 +39,8 @@ <%= f.select :issue_id, todo.possible_issues.collect{ |i| - ["##{i.id} #{i.subject[0..40]}... #{i.tracker.name}" , i.id] + subject = i.subject[0..40].scan(/([\x00-\x7f]|[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3})/).join + ["##{i.id} #{subject}... #{i.tracker.name}" , i.id] }, :prompt=> l(:todo_new_issue_tooltip) %>