r51689 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51688‎ | r51689 | r51690 >
Date:12:21, 10 June 2009
Author:yaron
Status:deferred
Tags:
Comment:
Fix for non-UTF-8-encoded files
Modified paths:
  • /trunk/extensions/DataTransfer/specials/DT_ImportCSV.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DataTransfer/specials/DT_ImportCSV.php
@@ -100,7 +100,11 @@
101101 static function getCSVData($csv_file, &$pages) {
102102 $table = array();
103103 while ($line = fgetcsv($csv_file)) {
104 - array_push($table, $line);
 104+ // fix values in case the file wasn't UTF-8 encoded -
 105+ // hopefully the UTF-8 value will work across all
 106+ // database encodings
 107+ $encoded_line = array_map('utf8_encode', $line);
 108+ array_push($table, $encoded_line);
105109 }
106110 fclose($csv_file);
107111 // check header line to make sure every term is in the

Status & tagging log