1

I have an encoding issue on this repository: https://github.com/franceimage/franceimage.github.io

1/ Accents are wrong when I display https://franceimage.github.io/json/youtube.json in my browser (served by github)

enter image description here

2/ However, accents are right when I display the same page but run it served locally (jekyll serve)

enter image description here

3/ Accents are right on the html pages (served by github pages)

enter image description here

Can somebody explain what is happening ?

YaFred
  • 9,698
  • 3
  • 28
  • 40

1 Answers1

1

When you call json/youtube.json :

  • Locally, you get a Content-Type:application/json; charset=UTF-8 response header.
  • From github pages, you get Content-Type:application/json.
  • Transmitted files are identical.

As RFC 4627 states : "JSON text SHALL be encoded in Unicode. The default encoding is UTF-8."

It seems that browsers are not falling back to utf-8 when they receive a Content-Type:application/json response header.

An idea can be to submit this question to Jekyll/Github pages community. Maybe you can introduce a feature request in order to get Github pages sending encoding header.

Jekyll talk can be a good entry point for such a question.

David Jacquel
  • 51,670
  • 6
  • 121
  • 147
  • I see. So, I just have to download the json file instead of copy/paste what I see in the browser. – YaFred Oct 17 '16 at 14:05