Skip to content

Commit

Permalink
Fixed issue: Stata export now properly supports UTF-8 charset
Browse files Browse the repository at this point in the history
  • Loading branch information
wuzhihui1123 committed Mar 29, 2021
1 parent 40d00a4 commit bbc2849
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/core/plugins/ExportSTATAxml/STATAxmlWriter.php
Expand Up @@ -50,7 +50,7 @@ public function init(SurveyObj $survey, $sLanguageCode, FormattingOptions $oOpti
parent::init($survey, $sLanguageCode, $oOptions);
if ($oOptions->output == 'display') {
header("Content-Disposition: attachment; filename=survey_" . $survey->id . "_STATA.xml");
header("Content-type: application/download; charset=US-ASCII");
header("Content-type: application/download; charset=UTF-8");
header("Cache-Control: must-revalidate, no-store, no-cache");
$this->handle = fopen('php://output', 'w');
} elseif ($oOptions->output == 'file') {
Expand Down Expand Up @@ -532,7 +532,7 @@ public function close()
$xml->setIndent(true);

//header
$xml->startDocument('1.0', 'US-ASCII');
$xml->startDocument('1.0', 'UTF-8');
$xml->startElement('dta');
$xml->startElement('header');
$xml->writeElement('ds_format', $this->statafileversion);
Expand Down

0 comments on commit bbc2849

Please sign in to comment.