3 # This is a script that will update files from 1.0.x versions if you
5 # Input is not proper UTF-8, indicate encoding !
6 # Bytes: 0xE9 0x73 0x20 0x70
7 # We aren't sure why these happen for some people, but given the age
8 # of the 1.0.x series we probably won't spend more time on the issue.
10 # It assumes that the files were using ISO8859-1 encoding. (Files
11 # from Gnumeric before 1.2 do not contain encoding information. That's
12 # the whole problem, in fact.)
14 # Adapted from script by daniel.savard@gmail.com
16 # Almost completely untested, btw.
17 # PLEASE BACKUP YOUR FILES FIRST!
20 tmp
=/tmp
/conv_$$.gnumeric
26 type=`file "$my_file" | sed -e 's/^.*:[ ]*//' -e 's/[ ].*//'`
27 if [ "$type" != "gzip" ]
30 echo "Incompatible file format."
34 if [ -w "$my_file" ]; then
35 gzip -d < "$my_file" |
iconv -f ISO8859-1
-t UTF-8 |
sed s
/'<?xml version="1.0"?>'/'<?xml version="1.0" encoding="UTF-8"?>'/ |
gzip > $tmp