diff --git a/pagure/templates/commit.html b/pagure/templates/commit.html index 1a4643b..faa11e2 100644 --- a/pagure/templates/commit.html +++ b/pagure/templates/commit.html @@ -54,10 +54,10 @@ {% set filecount = filecount + 1 %} {% if patch | hasattr('new_file_path') %} - {{ patch.new_file_path }} + {{ patch.new_file_path | unicode}} {% elif patch | hasattr('delta') %} - {{ patch.delta.new_file.path }} + {{ patch.delta.new_file.path | unicode }} {% endif %}
{% if not patch.is_binary %} @@ -102,13 +102,13 @@ - {{ patch.new_file_path }} + {{ patch.new_file_path | unicode }} {% elif patch | hasattr('delta') %} - {{ patch.delta.new_file.path }} + {{ patch.delta.new_file.path | unicode }} {% endif %} {% if not patch.is_binary %} diff --git a/pagure/templates/pull_request.html b/pagure/templates/pull_request.html index ee90cb9..af3837b 100644 --- a/pagure/templates/pull_request.html +++ b/pagure/templates/pull_request.html @@ -349,7 +349,7 @@ identifier=identifier, filename=filepath) }}" {% endif %} - title="View file as of {{ patch_new_id|short }}">{{filepath}} + title="View file as of {{ patch_new_id|short }}">{{filepath | unicode}} {% endmacro %} {% if patch | hasattr('new_file_path') %} diff --git a/pagure/ui/filters.py b/pagure/ui/filters.py index 28357bd..7462780 100644 --- a/pagure/ui/filters.py +++ b/pagure/ui/filters.py @@ -409,3 +409,7 @@ def text_wraps(dictionary): return max([int(k) for k in dictionary if k]) + 1 else: return 1 + +@APP.template_filter('unicode') +def convert_unicode(text): + return unicode(text, "utf8") diff --git a/tests/__init__.py b/tests/__init__.py index a5545a4..f39b1d9 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -330,6 +330,9 @@ def add_content_git_repo(folder): with open(os.path.join(newfolder, subfolder, 'file'), 'w') as stream: stream.write('foo\n bar\nbaz') repo.index.add(os.path.join(subfolder, 'file')) + with open(os.path.join(newfolder, subfolder, 'fileŠ'), 'w') as stream: + stream.write('foo\n bar\nbaz') + repo.index.add(os.path.join(subfolder, 'fileŠ')) repo.index.write() # Commits the files added