# BUG: HuggingFace creates jibberish characters with static HTML

**URL:** <https://discuss.huggingface.co/t/bug-huggingface-creates-jibberish-characters-with-static-html/139916>\
**Category:** Spaces\
**Created:** [February 9, 2025, 11:58pm UTC](https://discuss.huggingface.co/t/bug-huggingface-creates-jibberish-characters-with-static-html/139916 "2025-02-09T23:58:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![trusktr](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/trusktr/32/37636_2.png) [@trusktr](https://discuss.huggingface.co/u/trusktr)\
**Post date:** [February 9, 2025, 11:58pm UTC](https://discuss.huggingface.co/t/bug-huggingface-creates-jibberish-characters-with-static-html/139916/1 "2025-02-09T23:58:03Z")

</div>

At time of writing, this file,

> **[index.html · trusktr/trusktr at 684467fe557522bbde607b63230887e4368b0de1](https://huggingface.co/spaces/trusktr/trusktr/blob/684467fe557522bbde607b63230887e4368b0de1/index.html)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

can be see in App mode here:

> **[trusktr - a Hugging Face Space by trusktr](https://huggingface.co/spaces/trusktr/trusktr)**
>
> My landing page and scratch pad with live demos.

(EDIT: I hid emojis when served on HuggingFace)

And we can see that HuggingFace is doing something odd with the characters:

 ![Screenshot 2025-02-09 at 12.06.08 PM](https://us1.discourse-cdn.com/hellohellohello/original/3X/c/1/c1452346e320a15044e6092cf6f7466c30537be6.jpeg)

Note that I’ve already included `<meta charset="utf-8" />` in the page.

Here’s the same HTML page hosted directly from GitHub, which works without any odd character formatting issues:

[https://rawcdn.githack.com/trusktr/trusktr/5056cefe67fba007cbf3c9a2e927d404edca5797/index.html](https://rawcdn.githack.com/trusktr/trusktr/5056cefe67fba007cbf3c9a2e927d404edca5797/index.html)

(and it works fine locally too).

Seems like HuggingFace is doing some sort of conversion of the characters. In devtools, we can see that the response includes the mangled characters:

 ![Screenshot 2025-02-09 at 3.56.52 PM](https://us1.discourse-cdn.com/hellohellohello/original/3X/c/e/cecde8b29563b3eae4eb2609ea3fa5ac0aa075c5.jpeg)

Can you please fix this?

---

<div class="post-metadata">

**Author:** ![trusktr](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/trusktr/32/37636_2.png) [@trusktr](https://discuss.huggingface.co/u/trusktr)\
**Post date:** [February 10, 2025, 7:39am UTC](https://discuss.huggingface.co/t/bug-huggingface-creates-jibberish-characters-with-static-html/139916/2 "2025-02-10T07:39:57Z")

</div>

For now I am working around the issue by hiding emojis when the site is served on HuggingFace.

```html
		<script>
			// Add a class for HuggingFace so we can avoid rendering emojis there.
			if (location.href.includes('static.hf.space'))
				document.body.classList.add('huggingface')
		</script>

		<style>
			.huggingface .emoji {
				display: none;
			}
		</style>

```

---

<div class="post-metadata">

**Author:** ![trusktr](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/trusktr/32/37636_2.png) [@trusktr](https://discuss.huggingface.co/u/trusktr)\
**Post date:** [February 10, 2025, 7:36pm UTC](https://discuss.huggingface.co/t/bug-huggingface-creates-jibberish-characters-with-static-html/139916/3 "2025-02-10T19:36:55Z")

</div>

@John6666 Hello, I see you around a lot. Do you know if HuggingFace employees look at bug reports here? Or is there a better place to post bug reports?

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [February 10, 2025, 9:38pm UTC](https://discuss.huggingface.co/t/bug-huggingface-creates-jibberish-characters-with-static-html/139916/4 "2025-02-10T21:38:34Z")

</div>

If you write to Victor in the following Victor Posts, which you have already written about in another matter, Victor will be notified, and if you write to HF Discord Feedback, it will be easier for HF to understand.  
Also, if the matter is urgent and there is a clear person in charge, there is a way to send a mention to that person.  
There are also services that have active bug report locations, such as Hugging Chat and Zero GPU Space.  
The other thing is the issue section on github for each library, but this isn’t related to the library…

However, in this case, there is no clear person in charge or bug report location, so it would be best to either write to Victor’s Posts or HF Discord, or send an email to HF. I have written to HF Discord.

### Victor’s Post

> **[@victor on Hugging Face: "🙋 Calling all Hugging Face users! We want to hear...](https://huggingface.co/posts/victor/964839563451127)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

### Zero GPU Community Discussion

> **[zero-gpu-explorers/README · Discussions](https://huggingface.co/spaces/zero-gpu-explorers/README/discussions)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

### Hugging Chat Discussion

> **[huggingchat/chat-ui · Discussions](https://huggingface.co/spaces/huggingchat/chat-ui/discussions)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

### Hugging Face e-mail

[website@huggingface.co](mailto:website@huggingface.co)

---

<div class="post-metadata">

**Author:** ![trusktr](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/trusktr/32/37636_2.png) [@trusktr](https://discuss.huggingface.co/u/trusktr)\
**Post date:** [December 10, 2025, 8:37am UTC](https://discuss.huggingface.co/t/bug-huggingface-creates-jibberish-characters-with-static-html/139916/5 "2025-12-10T08:37:06Z")

</div>

Fixed by ensuring `<meta charset=utf-8 />` is placed in the top of the HTML file and not dynamically included with JS. I wonder what it is about HF that causes it though. Haven’t had the issue anywhere else.
