Re: Migrating file from the old gnumeric version to the current version

Just to let know others, if anyone encounter this problem in the future.

The solution was to explicitly specify the encoding in the XML
declaration in the first line of the document. The file itself was not
in the wrong format. Everything was just fine with it. The only thing,
the encoding was not specified. By default, the XML specification says
it is UTF-8, so, it shouldn't have been a problem.

I wrote a small shell script to insert the encoding specification, here it is:


if [ -f $tmp ]; then
  rm -f $tmp

type=`file "$my_file" | cut -d: -f2 | cut -d\  -f2`
if [ "$type" != "gzip" ]
  echo "$my_file"
  echo "Incompatible file format."

if [ -w "$my_file" ]; then
  gzcat "$my_file" | sed s/'<?xml version="1.0"?>'/'<?xml
version="1.0" encoding="UTF-8"?>'/ | gzip > $tmp
  mv $tmp "$my_file"

exit 0

No extensive error checking, so use it with precaution. It is taking
the filename as the single argument (quote if any blanks in the

So, at my sense, this is a bug. Don't know if it is a gnumeric or
libxml bug, but the behavior is clearly not what it should have been.

I am using libxml2-2.6.16 and gnumeric 1.4.1.

Daniel Savard

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]