support for recode as convertor

This commit is contained in:
Marc Delisle
2002-07-17 12:28:23 +00:00
parent 56c7987b63
commit b4d5d6bd17
2 changed files with 20 additions and 3 deletions

View File

@@ -5,6 +5,10 @@ phpMyAdmin - Changelog
$Id$
$Source$
2002-07-17 Marc Delisle <lem9@users.sourceforge.net>
* lang/sync_lang.sh: support for multiple convertors (recode added),
thanks to Michal Cihar
2002-07-17 Alexander M. Turek <rabus@users.sourceforge.net>
* libraries/common.lib.php3, libraries/config_import.lib.php3: Added
$cfg['PmaNoRelation_DisableWarning'] to the backwards compatibility code.

View File

@@ -5,6 +5,19 @@
# Written by Michal Cihar <nijel at users.sourceforge.net>
##
##
# convertor setup
##
# CONVERTOR_PARAMS is used for printf and it also receives two params: source
# and target charset
#
#for iconv
#CONVERTOR=iconv
#CONVERTOR_PARAMS="-f %s -t %s"
#for recode:
CONVERTOR=recode
CONVERTOR_PARAMS="%s..%s"
##
# names of translations to process
@@ -89,16 +102,16 @@ for base in $BASE_TRANSLATIONS ; do
if [ $charset = 'utf-8' ] ; then
# if we convert to utf-8, we should add allow_recoding
is_utf=yes
iconv -f $src_charset -t $charset $base.inc.php3| sed -e "s/$src_charset/$charset/" -e '/\$charset/a\
$CONVERTOR $(printf -- "$CONVERTOR_PARAMS" $src_charset $charset) < $base.inc.php3| sed -e "s/$src_charset/$charset/" -e '/\$charset/a\
$allow_recoding = TRUE;' > $file
echo done
elif [ $src_charset = 'utf-8' ] ; then
# if we convert fomo utf-8, we should remove allow_recoding
iconv -f $src_charset -t $charset $base.inc.php3| grep -v allow_recoding > $file
$CONVERTOR $(printf -- "$CONVERTOR_PARAMS" $src_charset $charset) < $base.inc.php3| grep -v allow_recoding > $file
echo done
else
# just convert
iconv -f $src_charset -t $charset $base.inc.php3| sed "s/$src_charset/$charset/" > $file
$CONVERTOR $(printf -- "$CONVERTOR_PARAMS" $src_charset $charset) < $base.inc.php3| sed "s/$src_charset/$charset/" > $file
echo done
fi
done