kaputtnik has proposed merging lp:~widelands-dev/widelands-website/read_changelog_utf8 into lp:widelands-website.
Requested reviews: Widelands Developers (widelands-dev) Related bugs: Bug #1242354 in Widelands Website: "Changelog page is empty; use unicode for input" https://bugs.launchpad.net/widelands-website/+bug/1242354 For more details, see: https://code.launchpad.net/~widelands-dev/widelands-website/read_changelog_utf8/+merge/332990 Use utf-8 encoding when reading the ChangeLog. I have tested also other places where files are read: - Uploading maps - Developers Something else? Except the ChangeLog all are working fine without using the codecs module. For the Developers list i've added a TOC, because this list is very long. -- Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands-website/read_changelog_utf8 into lp:widelands-website.
=== modified file 'mainpage/views.py' --- mainpage/views.py 2016-12-13 18:28:51 +0000 +++ mainpage/views.py 2017-10-30 13:51:18 +0000 @@ -13,6 +13,7 @@ import os import os.path import locale +import codecs def mainpage(request): @@ -67,7 +68,7 @@ # Get locale and translator names from each .json file and # store them in one list. - txt = '' + txt = '[TOC]\n\n' transl_files = [] transl_list = [] path = os.path.normpath(WIDELANDS_SVN_DIR + 'data/i18n/locales/') @@ -144,7 +145,7 @@ This replaces the wiki changelog """ - data = open(WIDELANDS_SVN_DIR + 'ChangeLog', 'r').read() + data = codecs.open(WIDELANDS_SVN_DIR + 'ChangeLog', encoding='utf-8', mode='r').read() return render_to_response('mainpage/changelog.html', {'changelog': data}, context_instance=RequestContext(request) === modified file 'templates/mainpage/developers.html' --- templates/mainpage/developers.html 2012-05-04 16:52:39 +0000 +++ templates/mainpage/developers.html 2017-10-30 13:51:18 +0000 @@ -1,9 +1,9 @@ {% extends "base.html" %} -{% load wl_markdown %} {% block title %}Widelands Development Team - {{ block.super }}{% endblock %} {% block extra_head %} +<link rel="stylesheet" type="text/css" media="all" href="{{ MEDIA_URL }}css/wiki.css" /> {{ block.super}} {% endblock %}
_______________________________________________ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp