# Mojibake on github for Jupyter notebooks

**URL:** <https://discourse.julialang.org/t/mojibake-on-github-for-jupyter-notebooks/89320>\
**Category:** Offtopic\
**Tags:** jupyter\
**Created:** [October 26, 2022, 6:52pm UTC](https://discourse.julialang.org/t/mojibake-on-github-for-jupyter-notebooks/89320 "2022-10-26T18:52:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [October 26, 2022, 6:52pm UTC](https://discourse.julialang.org/t/mojibake-on-github-for-jupyter-notebooks/89320/1 "2022-10-26T18:52:54Z")

</div>

Has anyone else noticed that Github is suddenly rendering any Unicode characters in Jupyter notebooks as [mojibake](https://en.wikipedia.org/wiki/Mojibake) (garbled characters like “Ã¢Â€Â”Ã”), e.g. in [this notebook for my class](https://github.com/mitmath/1806/blob/80892d985a6643ac0d7f16074237d0a30dd7046a/psets/pset7.ipynb)?

Is there any way to fix it? I don’t recall it happening before — it’s as if they are suddenly interpreting notebooks as Windows-1252 or some other non-UTF8 encoding.

Sorry for the offtopic, but I figured it might have bit other Julia people since we use Unicode so extensively. (My workaround for now is to view notebooks on github via [nbviewer.org](http://nbviewer.org).)

---

<div class="post-metadata">

**Author:** ![Krastanov](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/krastanov/32/6817_2.png) [@Krastanov](https://discourse.julialang.org/u/Krastanov)\
**Post date:** [October 26, 2022, 7:42pm UTC](https://discourse.julialang.org/t/mojibake-on-github-for-jupyter-notebooks/89320/2 "2022-10-26T19:42:19Z")

</div>

renders fine on firefox version 106 and chrome version 107 on ubuntu 22.04…

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [October 26, 2022, 7:45pm UTC](https://discourse.julialang.org/t/mojibake-on-github-for-jupyter-notebooks/89320/3 "2022-10-26T19:45:20Z")

</div>

Interestingly, I see it on some loads of the page and not others. In one rendition I see the correct text:

```nohighlight
rapidly decreasing &#8212;&#160;you could set

```

In another rendition I see the mojibake version:

```nohighlight
rapidly decreasing &#195;&#162;&#194;&#128;&#194;&#148;&#195;&#130;&#194;&#160;you could set

```

You can transform the correct version of the non-ASCII bit like this:

```julia
julia> text = Char(8212) * Char(160)
"— "

julia> map(Int, codeunits(join(map(Char, codeunits(text)))))
10-element Vector{Int64}:
 195
 162
 194
 128
 194
 148
 195
 130
 194
 160

```

From which we can infer that some layer of code is treating each code unit as a code point (i.e. interpreting the text as Latin-1), and then some other layer interprets the code units of that text as code units.

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [October 26, 2022, 7:57pm UTC](https://discourse.julialang.org/t/mojibake-on-github-for-jupyter-notebooks/89320/4 "2022-10-26T19:57:45Z")

</div>

For me I get “rapidly decreasing — you” i.e. correct (and I can right click get the source and confirm UTF-8 used, I suppose this is a server issue and you would always say that, even if broken). I tried going to:

[https://github.dev/mitmath/1806/blob/master/psets/pset7.ipynb](https://github.dev/mitmath/1806/blob/master/psets/pset7.ipynb)

and then I get narrower hyphen, though sort of ok, and can’t right click to get source… (it’s blocked by UI code, and I’m not sure there’s a workaround for that, except maybe by disabling JavaScript).

[Karpinski shows “&#160”, i.e. non-break space _on the right_ of the “em dash”, is that right to do? Copy-pasting I however get a regular ASCII space on both sides… Wikipedia rules have em dash unspaced, and en dash spaced. I believe you would then only use non-break space on the left, but at least on Wikipedia in my Firefox, it doesn’t seems to copy as such, maybe intentional for Firefox.]

I CAN copy paste-this non-break space from the terminal to the terminal, but not from the web:

```julia
julia> text = Char(8212) * Char(160)
"— "

```

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [October 26, 2022, 9:43pm UTC](https://discourse.julialang.org/t/mojibake-on-github-for-jupyter-notebooks/89320/5 "2022-10-26T21:43:58Z")

</div>

Looks like they may have fixed the bug? I can’t reproduce the mojibake anymore.

(I did file a github support request, but didn’t get any response so I assumed they hadn’t looked into it yet.)
