Skip to content

Commit 60bb367

Browse files
committed
Fix to incompatible character encodings error #40
1 parent b5ab527 commit 60bb367

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

init.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
name 'View Customize plugin'
44
author 'onozaty'
55
description 'View Customize plugin for Redmine'
6-
version '2.3.0'
6+
version '2.3.0.40-1'
77
url 'https://github.com/onozaty/redmine-view-customize'
88
author_url 'https://github.com/onozaty'
99

lib/view_customize/view_hook.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module RedmineViewCustomize
22
class ViewHook < Redmine::Hook::ViewListener
33
def view_layouts_base_html_head(context={})
44

5-
path = context[:request].path_info;
5+
path = context[:request].path_info.force_encoding('UTF-8');
66

77
html = "\n<!-- [view customize plugin] path:#{path} -->\n"
88
html << stylesheet_link_tag("view_customize", plugin: "view_customize")
@@ -17,7 +17,7 @@ def view_layouts_base_html_head(context={})
1717

1818
def view_issues_form_details_bottom(context={})
1919

20-
return create_view_customize_html(context[:request].path_info, ViewCustomize::INSERTION_POSITION_ISSUE_FORM)
20+
return create_view_customize_html(context[:request].path_info.force_encoding('UTF-8'), ViewCustomize::INSERTION_POSITION_ISSUE_FORM)
2121
end
2222

2323
def view_issues_show_details_bottom(context={})
@@ -26,7 +26,7 @@ def view_issues_show_details_bottom(context={})
2626
html << "ViewCustomize.context.issue = { id: #{context[:issue].id} };"
2727
html << "\n//]]>\n</script>"
2828

29-
html << create_view_customize_html(context[:request].path_info, ViewCustomize::INSERTION_POSITION_ISSUE_SHOW)
29+
html << create_view_customize_html(context[:request].path_info.force_encoding('UTF-8'), ViewCustomize::INSERTION_POSITION_ISSUE_SHOW)
3030

3131
return html
3232
end

0 commit comments

Comments
 (0)