Dear all, I use Sweave to create my reports. my pdf output contains only NA's whenever my text contains special Danish characters like ø, ø and å. I have upgraded R from 2.13 to 2.15 and the scripts worked fine under R 2.13. Sweave("Test.Rnw", encoding = "utf8") texi2dvi("Test.tex", pdf = TRUE) %"Test.Rnw" \documentclass{article} \usepackage [danish]{babel} \usepackage[utf8]{inputenc} \begin{document} This is a test that works \end{document} %"Test.Rnw" \documentclass{article} \usepackage [danish]{babel} \usepackage[utf8]{inputenc} \begin{document} This doesn't æ ø å and pdf document only contains NA \end{document} Any suggestions? Best wishes Jonas Hal _________________________________________________________________________________________________________________________________________ BRFkredit sender e-mails og vedhæftede dokumenter i ikke-krypteret form. Hvis du ikke ønsker at modtage oplysninger fra BRFkredit pr. e-mail, beder vi dig meddele os det via brev eller e-mail. Denne e-mail kan indeholde fortrolig information. Hvis du modtager e-mailen ved en fejl, beder vi dig informere os om det hurtigst muligt. Samtidig beder vi dig slette e-mailen uden at videresende eller kopiere indholdet. _________________________________________________________________________________________________________________________________________ [[alternative HTML version deleted]]
On 08/08/2012 6:15 AM, Jonas Hal wrote:> Dear all, > > I use Sweave to create my reports. my pdf output contains only NA's whenever my text contains special Danish characters like ?, ? and ?. I have upgraded R from 2.13 to 2.15 and the scripts worked fine under R 2.13. > > Sweave("Test.Rnw", encoding = "utf8") > texi2dvi("Test.tex", pdf = TRUE) > > %"Test.Rnw" > \documentclass{article} > \usepackage [danish]{babel} > \usepackage[utf8]{inputenc} > \begin{document} > This is a test that works > \end{document} > > %"Test.Rnw" > \documentclass{article} > \usepackage [danish]{babel} > \usepackage[utf8]{inputenc} > \begin{document} > This doesn't ? ? ? and pdf document only contains NA > \end{document} > > Any suggestions?I think you need to give more information. I just tried it in 2.15.1 patched on Windows 32 bit, and it worked fine. What OS are you using? Is the file really encoded using utf-8? What version of R were you using (there's no such thing as 2.15)? Where did you find the texi2dvi function? (There's one in the tools package, but it isn't normally attached. Are you using that one, or your own?) Duncan Murdoch
Hi Johas, I've run into a similar problem due to Emacs on OSX setting my locale to "C". If you're on Mac or Linux you can try setting Sys.setlocale(category = "LC_ALL", locale = "UTF-8") before calling Sweave() Best, Ista This doesn't ? ? ? and pdf document only contains NA On Wed, Aug 8, 2012 at 6:15 AM, Jonas Hal <JOH at brf.dk> wrote:> Dear all, > > I use Sweave to create my reports. my pdf output contains only NA's whenever my text contains special Danish characters like ?, ? and ?. I have upgraded R from 2.13 to 2.15 and the scripts worked fine under R 2.13. > > Sweave("Test.Rnw", encoding = "utf8") > texi2dvi("Test.tex", pdf = TRUE) > > %"Test.Rnw" > \documentclass{article} > \usepackage [danish]{babel} > \usepackage[utf8]{inputenc} > \begin{document} > This is a test that works > \end{document} > > %"Test.Rnw" > \documentclass{article} > \usepackage [danish]{babel} > \usepackage[utf8]{inputenc} > \begin{document} > This doesn't ? ? ? and pdf document only contains NA > \end{document} > > Any suggestions? > > Best wishes > Jonas Hal > > > > _________________________________________________________________________________________________________________________________________ > BRFkredit sender e-mails og vedh?ftede dokumenter i ikke-krypteret form. Hvis du ikke ?nsker at modtage oplysninger fra BRFkredit pr. e-mail, beder vi dig meddele os det via brev eller e-mail. Denne e-mail kan indeholde fortrolig information. Hvis du modtager e-mailen ved en fejl, beder vi dig informere os om det hurtigst muligt. Samtidig beder vi dig slette e-mailen uden at videresende eller kopiere indholdet. > _________________________________________________________________________________________________________________________________________ > > [[alternative HTML version deleted]] > > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >