From d28c615af405d6641f943131c0542b36026ff9a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 29 Nov 2005 19:04:05 +0000 Subject: [PATCH] Add workaround for multibyte chars that can contain \ as last byte. --- ChangeLog | 4 ++++ lang/sync_lang.sh | 30 +++++++++--------------------- 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 51057adb8..a28681c16 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ phpMyAdmin - Changelog $Id$ $Source$ +2005-11-29 Michal Čihař + * lang/sync_lang.sh: Add workaround for multibyte chars that can contain \ + as last byte. + 2005-11-29 Marc Delisle * tbl_change.php, libraries/tbl_replace_fields.inc.php: bug #1367549, handling of CURRENT_TIMESTAMP diff --git a/lang/sync_lang.sh b/lang/sync_lang.sh index 310b6b65c..a2f8d62c3 100755 --- a/lang/sync_lang.sh +++ b/lang/sync_lang.sh @@ -11,6 +11,8 @@ # Written by Michal Cihar ## # Changes: +# 2005-11-29 +# * hack for multibyte chars, so that \'; at the end will not fool PHP # 2004-09-22 # * default to iconv, as it doesn't break things as recode does # 2004-09-03 @@ -220,34 +222,20 @@ for base in $BASE_TRANSLATIONS ; do is_utf=yes $CONVERTOR $(printf "$CONVERTOR_PARAMS" $src_charset $charset) < $base.inc.php| sed -e "s/$replace_charset/$charset/" -e '/\$charset/a\ $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 is_utf=yes # 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 - if [ -s $TEMPFILE ] ; then - cat $TEMPFILE > $file - echo done - else - FAILED="$FAILED $file" - echo FAILED - fi else # just convert $CONVERTOR $(printf "$CONVERTOR_PARAMS" $src_charset $charset) < $base.inc.php| sed "s/$replace_charset/$charset/" > $TEMPFILE - if [ -s $TEMPFILE ] ; then - cat $TEMPFILE > $file - echo done - else - FAILED="$FAILED $file" - echo FAILED - fi + fi + if [ -s $TEMPFILE ] ; then + sed "s/\\\\';[[:space:]]*$/\\ ';/" $TEMPFILE > $file + echo done + else + FAILED="$FAILED $file" + echo FAILED fi done