From cf006572b7809739e8d027e1bbbc85ef99c3adcc Mon Sep 17 00:00:00 2001 From: Alexis Bezverkhyy Date: Wed, 23 Oct 2013 17:34:03 +0200 Subject: [PATCH] Fix: Word export encoding was said to be latin, but is in fact UTF-8 Dev: by default Word uses local 8-bit encodings (CP-1252 for Europe etc.) but LimeSurvey exports UTF-8 without specifying the encoding in the resulting document. This patch adds a tag setting charset to UTF-8 in the resulting .doc. It also corrects the label of the export option from latin to UTF-8. --- application/core/plugins/Authdb/Authdb.php | 2 +- application/helpers/admin/export/DocWriter.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/application/core/plugins/Authdb/Authdb.php b/application/core/plugins/Authdb/Authdb.php index fec426fff37..14ba4d19fca 100644 --- a/application/core/plugins/Authdb/Authdb.php +++ b/application/core/plugins/Authdb/Authdb.php @@ -159,7 +159,7 @@ public function listExportOptions() break; case 'doc': - $event->set('label', gT("Microsoft Word (Latin charset)")); + $event->set('label', gT("Microsoft Word (UTF-8 charset)")); $event->set('onclick', 'document.getElementById("ansfull").checked=true;document.getElementById("ansabbrev").disabled=true;'); break; diff --git a/application/helpers/admin/export/DocWriter.php b/application/helpers/admin/export/DocWriter.php index b95dc5d00fc..f1119fe2c7c 100644 --- a/application/helpers/admin/export/DocWriter.php +++ b/application/helpers/admin/export/DocWriter.php @@ -27,7 +27,8 @@ public function init(SurveyObj $survey, $sLanguageCode, FormattingOptions $oOpti } - $sOutput = '