diff --git a/modules/data_cleaner/controllers/verification_rule.php b/modules/data_cleaner/controllers/verification_rule.php index 78a8f8dcca..b17b5dcbd7 100644 --- a/modules/data_cleaner/controllers/verification_rule.php +++ b/modules/data_cleaner/controllers/verification_rule.php @@ -386,6 +386,9 @@ private function internal_upload_rule_file($totaldone, $cacheArr) { throw new exception("Could not open file $filepath"); } $filecontent = fread($resource,1000000); + // if no BOM, not unicode, so convert for safety. See Warehouse issue 22. + if (strpos($filecontent, "\xEF\xBB\xBF")!==0) + $filecontent = utf8_encode($filecontent); $settings = data_cleaner::parse_test_file($filecontent); $this->read_rule_content($settings, $cacheArr['files'][$totaldone]['path'], $cacheArr['files'][$totaldone]['source_url']); return $cacheArr['files'][$totaldone]['display'];