From ba420a2827d32f1e0e367ca03b53f82d7cd366a0 Mon Sep 17 00:00:00 2001 From: "Kingson.zhou" Date: Mon, 13 Oct 2014 15:08:17 +0800 Subject: [PATCH 1/3] Fixed display random code in test report When display random code that include Chinese characters in test report, change encoding type latin-1 to utf-8. --- HTMLTestRunner.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/HTMLTestRunner.py b/HTMLTestRunner.py index 8d60600..c941d6d 100644 --- a/HTMLTestRunner.py +++ b/HTMLTestRunner.py @@ -774,13 +774,13 @@ def _generate_report_test(self, rows, cid, tid, n, t, o, e): if isinstance(o,str): # TODO: some problem with 'string_escape': it escape \n and mess up formating # uo = unicode(o.encode('string_escape')) - uo = o.decode('latin-1') + uo = o.decode('utf-8') else: uo = o if isinstance(e,str): # TODO: some problem with 'string_escape': it escape \n and mess up formating # ue = unicode(e.encode('string_escape')) - ue = e.decode('latin-1') + ue = e.decode('utf-8') else: ue = e From 053bb9ea6c0eb7e8bb6592dfeb92835106f19664 Mon Sep 17 00:00:00 2001 From: "Kingson.zhou" Date: Mon, 13 Oct 2014 15:23:27 +0800 Subject: [PATCH 2/3] Edit README Edit README --- README | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README b/README index b1beea9..df99031 100644 --- a/README +++ b/README @@ -3,3 +3,6 @@ It generates easy to use HTML test reports. HTMLTestRunner is released under a BSD style license. Only a single file module HTMLTestRunner.py is needed to generate your report. + +Addtions: +Change encoding type latin-1 to utf-8, When display garbled characters that include Chinese characters in test report. From 4e6b29759cb08dacd474db4368e7d22c14a342ac Mon Sep 17 00:00:00 2001 From: "Kingson.zhou" Date: Mon, 13 Oct 2014 15:24:27 +0800 Subject: [PATCH 3/3] Update README --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index df99031..1307637 100644 --- a/README +++ b/README @@ -4,5 +4,5 @@ BSD style license. Only a single file module HTMLTestRunner.py is needed to generate your report. -Addtions: +Additions: Change encoding type latin-1 to utf-8, When display garbled characters that include Chinese characters in test report.