Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Ben Os
Ben Os
20,008 Points

InnerHTML hebrew string shown as question marks

Hello,

I changed an innerHTML of a Wordpress menu-toggle from English to Hebrew and now it appears as question marks. The reason for doing this with Js is a long story I prefer not to go into. My question is why there are question marks and is there as Js based solution?

That's the code I used:

let changeLinkText = document.querySelector(".mobile-menu");
changeLinkText.innerHTML = "תפריט";

I should note that the site itself includes Hebrew without any problem: Everything is RTLized and translated almost anywhere without problems.

Zac Gordon

1 Answer

Ben Os
Ben Os
20,008 Points

The problem was with the encoding Notepad++ saved the file. I did the following and it was solved:

Encoding > Encode in UTF-8.

So, if it happens to you, make sure you work with an encoding suitable for any non English content you might have.