When I add text in Hebrew inside html.tpl.php, it shows me strange characters instead of the ones I am expecting.

How can I fix this?



You need to set the encoding of new files to utf-8 in your text-editor. The image below is on Notepad++. There should be a similar setting in your text editor.

enter image description here

To test if you got it right, create an HTML/PHP file with the Hebrew text outside of Drupal first.

For Notepad, Save As and select UTF-8 as the Encoding.

enter image description here

Also, make sure you have the following line in the <head> tag of your HTML:

<meta charset="utf-8">
  • I added a <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> but still shows me question marks – user26893 Mar 3 '14 at 6:05
  • I added an image about what I meant. – Randell Mar 3 '14 at 6:19
  • im using the regular notepad ... and also that happens in any template i have on my system out side the drupal its works ok – user26893 Mar 3 '14 at 6:22
  • I added information for saving to UTF-8 in Notepad. – Randell Mar 3 '14 at 6:26
  • 1
    You should really save out without the BOM. Having the BOM inside files, especially any PHP, can cause some weird problems. It can also cause errors when aggregating CSS. – mpdonadio Apr 9 '14 at 19:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.