Add workaround for multibyte chars that can contain \ as last byte.

This commit is contained in:
Michal Čihař
2005-11-29 19:04:05 +00:00
parent 75ba7193a3
commit d28c615af4
2 changed files with 13 additions and 21 deletions

View File

@@ -5,6 +5,10 @@ phpMyAdmin - Changelog
$Id$ $Id$
$Source$ $Source$
2005-11-29 Michal Čihař <michal@cihar.com>
* lang/sync_lang.sh: Add workaround for multibyte chars that can contain \
as last byte.
2005-11-29 Marc Delisle <lem9@users.sourceforge.net> 2005-11-29 Marc Delisle <lem9@users.sourceforge.net>
* tbl_change.php, libraries/tbl_replace_fields.inc.php: * tbl_change.php, libraries/tbl_replace_fields.inc.php:
bug #1367549, handling of CURRENT_TIMESTAMP bug #1367549, handling of CURRENT_TIMESTAMP

View File

@@ -11,6 +11,8 @@
# Written by Michal Cihar <nijel at users.sourceforge.net> # Written by Michal Cihar <nijel at users.sourceforge.net>
## ##
# Changes: # Changes:
# 2005-11-29
# * hack for multibyte chars, so that \'; at the end will not fool PHP
# 2004-09-22 # 2004-09-22
# * default to iconv, as it doesn't break things as recode does # * default to iconv, as it doesn't break things as recode does
# 2004-09-03 # 2004-09-03
@@ -220,34 +222,20 @@ for base in $BASE_TRANSLATIONS ; do
is_utf=yes is_utf=yes
$CONVERTOR $(printf "$CONVERTOR_PARAMS" $src_charset $charset) < $base.inc.php| sed -e "s/$replace_charset/$charset/" -e '/\$charset/a\ $CONVERTOR $(printf "$CONVERTOR_PARAMS" $src_charset $charset) < $base.inc.php| sed -e "s/$replace_charset/$charset/" -e '/\$charset/a\
$allow_recoding = TRUE;' > $TEMPFILE $allow_recoding = TRUE;' > $TEMPFILE
if [ -s $TEMPFILE ] ; then
cat $TEMPFILE > $file
echo done
else
FAILED="$FAILED $file"
echo FAILED
fi
elif [ $src_charset = 'utf-8' ] ; then elif [ $src_charset = 'utf-8' ] ; then
is_utf=yes is_utf=yes
# if we convert from utf-8, we should remove allow_recoding # if we convert from utf-8, we should remove allow_recoding
$CONVERTOR $(printf "$CONVERTOR_PARAMS" $src_charset $charset) < $base.inc.php| grep -v allow_recoding | sed "s/$replace_charset/$charset/" > $TEMPFILE $CONVERTOR $(printf "$CONVERTOR_PARAMS" $src_charset $charset) < $base.inc.php| grep -v allow_recoding | sed "s/$replace_charset/$charset/" > $TEMPFILE
if [ -s $TEMPFILE ] ; then
cat $TEMPFILE > $file
echo done
else
FAILED="$FAILED $file"
echo FAILED
fi
else else
# just convert # just convert
$CONVERTOR $(printf "$CONVERTOR_PARAMS" $src_charset $charset) < $base.inc.php| sed "s/$replace_charset/$charset/" > $TEMPFILE $CONVERTOR $(printf "$CONVERTOR_PARAMS" $src_charset $charset) < $base.inc.php| sed "s/$replace_charset/$charset/" > $TEMPFILE
if [ -s $TEMPFILE ] ; then fi
cat $TEMPFILE > $file if [ -s $TEMPFILE ] ; then
echo done sed "s/\\\\';[[:space:]]*$/\\ ';/" $TEMPFILE > $file
else echo done
FAILED="$FAILED $file" else
echo FAILED FAILED="$FAILED $file"
fi echo FAILED
fi fi
done done