diff options
author | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-11-21 18:24:37 +0000 |
---|---|---|
committer | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-11-21 18:24:37 +0000 |
commit | 8e73e4600bc859972a73c6cabc586706bc0ac62d (patch) | |
tree | 212cb4dd90fa79e52b7377c6a3374dcb637b0264 | |
parent | 70d494620c94d05c4d184dac9f883b5b447a2d74 (diff) | |
download | brdo-8e73e4600bc859972a73c6cabc586706bc0ac62d.tar.gz brdo-8e73e4600bc859972a73c6cabc586706bc0ac62d.tar.bz2 |
#173858 by myself: skip UTF-8 BOM when importing locale files
-rw-r--r-- | includes/locale.inc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/includes/locale.inc b/includes/locale.inc index f6940da88..250fa90cc 100644 --- a/includes/locale.inc +++ b/includes/locale.inc @@ -1015,6 +1015,10 @@ function _locale_import_read_po($op, $file, $mode = NULL, $lang = NULL, $group = while (!feof($fd)) { $line = fgets($fd, 10*1024); // A line should not be this long + if ($lineno == 0) { + // The first line might come with a UTF-8 BOM, which should be removed. + $line = str_replace("\xEF\xBB\xBF", '', $line); + } $lineno++; $line = trim(strtr($line, array("\\\n" => ""))); |