Umberto
Umberto

Reputation: 1421

Wrong encoding with github markdown and R

I am trying to publish some R markdown files on github pages. I am using this

---
title: "k-Fold Cross Validation"
author: "N/A"
date: "10 April 2017"
output: 
   md_document:
     variant: markdown_github
encoding: UTF-8
---

I am writing my files in R Studio and in Global Options I have set the encoding to UTF-8. Now when I put the files on github and let jekyll do its magic I get the following error on the image files!

"The file _posts/...../...../....png" ist not properly UTF-8 encoded.

Does anyone have any idea why? I am not using any strange character in the images (not in the titles, not in the labels, and so on). All plain english.

This is the image that gives me the error message

enter image description here

Thanks in advance, Umberto

Upvotes: 1

Views: 391

Answers (1)

Umberto
Umberto

Reputation: 1421

Now I found an answer thanks to the support of github and I thought of posting it here to help other people that might find the same problem. The problem is that jekyll does not accept images in the _posts directory. If you need to add images, create a /assets folder in your root directory and put your images there. It will work like a charm.

I hope it may help someone.

Upvotes: 2

Related Questions