BUG: HuggingFace creates jibberish characters with static HTML

At time of writing, this file,

can be see in App mode here:

(EDIT: I hid emojis when served on HuggingFace)

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

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

(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:

Can you please fix this?

1 Like

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

		<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>
1 Like

@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?

1 Like

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

Zero GPU Community Discussion

Hugging Chat Discussion

Hugging Face e-mail

website@huggingface.co

2 Likes