1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-11 17:14:07 +02:00

Parse UTF-16 and UTF-8 BOM in all text uploads

This commit is contained in:
Jakub Vrana
2011-03-07 14:27:03 +01:00
parent db030df487
commit 9ff10f8301
2 changed files with 10 additions and 2 deletions

View File

@@ -141,7 +141,7 @@ if ($_POST && !$error) {
queries_redirect(remove_from_uri(), lang('%d item(s) have been affected.', $affected), $result);
}
} elseif (is_string($file = get_file("csv_file", true))) {
$file = preg_replace("~^\xEF\xBB\xBF~", '', $file); //! character set
//! character set
$result = true;
$cols = array_keys($fields);
preg_match_all('~(?>"[^"]*"|[^"\\r\\n]+)+~', $file, $matches);