2

Getting this error calling ODFWeave on my doc.

 Pre-processing the contents
 Sweaving  content.Rnw 

 Error: ‘content.Rnw’ is not ASCII and does not declare an encoding

I've seen some ways you can add an encoding switch in LaTeX docs "(Sweave --encoding=utf-8)", but don't know if this can be done with odfWeave

I've worked around it before by converting the source doc back to ASCII, but ideally it would be nice if the conversion would run with whatever is in my doc (and some names, for example, require a non-ASCII charset).

paulusm
  • 786
  • 6
  • 19

1 Answers1

1

We made changes to odfWeave so that it (rightly) uses a utf-8 encoding. In fact, we coerce this by using the 'encoding="UTF-8"' option to Sweave.

I guess the question is "why isn't the document utf-8"? Honestly, I dont really have a good answer for you since I don't have the document (or the results of sessionInfo()). You might be creating non-utf8 characters in the course of weaving.

One thread that might help is this:

http://r.789695.n4.nabble.com/Running-odfWeave-on-its-own-examples-odt-td4639889.html

Figuring this out appears pretty complex and I wish I had a clear-cut answer for you.

topepo
  • 13,534
  • 3
  • 39
  • 52
  • What would be the best way to find offending characters? I can't see any relevant menu options (I'm using LibreOffice Writer) – paulusm Aug 23 '12 at 10:34
  • I found this on SO a few days ago: `grep -e "[\x{00FF}-\x{FFFF}]" file.xml` – topepo Aug 24 '12 at 16:11