randy3k / R-Box

R package for Sublime Text 3
MIT License
173 stars 27 forks source link

Building sweave documents written in UTF-8 encoding #131

Closed kw-lee closed 6 years ago

kw-lee commented 6 years ago

When I tried to build sweave documents written in UTF-8 encoding, Every character was broken. I found this problem came from the option in 'R sweave.sublime-build' (Using PackageResourceViewer)

    "variants": [
        {
            "name": "knitr",
            "cmd": [
                "Rscript", "-e",
                "knitr::knit('$file_name'); tools::texi2dvi('$file_base_name.tex', pdf = TRUE)"
            ]
        }
    ],

I can solve this problem changing knitr::knit('$file_name') to knitr::knit('$file_name',encoding='UTF-8') Can you add option 'building sweave documents written in UTF-8 encoding ' in package settings?

randy3k commented 6 years ago

I believe it can be solved by setting the encoding key of options.

kw-lee commented 6 years ago

There was such a way, it works! Thank you!