I'm downloading a webpage from within R using xml2
, and then using pandoc to convert it to pdf.
My R code
library(xml2)
download_html("https://thehustle.co/apple-christmas-present", "test.html")
cmd line
pandoc test.html -o converted.pdf
This fails with the error
pandoc: Cannot decode byte '\xf9': Data.Text.Internal.Encoding.decodeUtf8: Invalid UTF-8 stream
I'm not sure whats going on here. If the webpage is not in utf-8 (and that is the root error), is there someway to convert it to?