Jean-Jacques Clar a dit :
> Which encoding should be used for the .fr files?
> I started using UTF-8 (which is cool because I could type directly special
> characters like �, �, �), but the source document I am reviewing is also
> iso-8859-1.
>
> Thanks,
> JJ
>
>
>

I have built a dirty shell script I run on XML files.
This way, I type in the text with accents into the XML file,
then have them converted to valid 8859-1 using the script.

Script is attached, and script is pretty ugly, but works for me :-).

Just in case it helps..

Vincent
#!/bin/sh

ARG1=$1

WHO=`whoami`

ARG2=/tmp/tempaccentsfile.$WHO
ARG3=$ARG1.tmp

[ -f $ARG1 ] || exit #Input file
[ -f $ARG2 ] && exit #temporary file
[ -f $ARG3 ] && exit #output file

sed -e 's/�/\à/g' $ARG1 > $ARG2
sed -e 's/�/\â/g' $ARG2 > $ARG3
mv $ARG3 $ARG2
sed -e 's/�/\é/g' $ARG2 > $ARG3
mv $ARG3 $ARG2
sed -e 's/�/\è/g' $ARG2 > $ARG3
mv $ARG3 $ARG2
sed -e 's/�/\ê/g' $ARG2 > $ARG3
mv $ARG3 $ARG2
sed -e 's/�/\ô/g' $ARG2 > $ARG3
mv $ARG3 $ARG2
sed -e 's/�/\ù/g' $ARG2 > $ARG3
mv $ARG3 $ARG2
sed -e 's/�/\û/g' $ARG2 > $ARG3
mv $ARG3 $ARG2
sed -e 's/�/\ç/g' $ARG2 > $ARG3
mv $ARG3 $ARG2
sed -e 's/�/\©/g' $ARG2 > $ARG3
mv $ARG3 $ARG2
sed -e 's/�/\î/g' $ARG2 > $ARG3
mv $ARG3 $ARG2
sed -e 's/�/\É/g' $ARG2 > $ARG3
mv $ARG3 $ARG2
sed -e 's/�/\È/g' $ARG2 > $ARG3
mv $ARG3 $ARG2
sed -e 's/�/\®/g' $ARG2 > $ARG3
rm $ARG2

mv $ARG3 $ARG1
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to