Jump to content

[solution] configuring utf-8 as default for all pages


atesin

Recommended Posts

for languages other than english (and for english symbols itself) , for example: spanish (Ñ, accented letters), portugese and french (cedilla), nordic countries (umlaut), etc etc

sometimes my spanish pages (i am chilean) show some garbage characters...  is very tedious to change every single html file to add <meta charset='UTF-8'/> or add html entities in all html + text files !!  ....  in my home server (nginx) i have a wide configuration to add Content-Type: text/html; charset=UTF-8 header always , but i dont know how to do it here.... until now....

go to plesk ....

> left panel > websites + domains .... 

> conent view > hosting + dns tab ....

> lower view > apache + nginx settings ...

> content view > common apache settings > mime types > check "enter custom value"

....  in textarea you can add one custom mime type each line ...   the last word (separated by space) must be the file extension

plesk search for the first space and cut the string there ..  as the string text/html; charset=UTF-8 have a space in the middle it gets truncated...  the soultion i found is to enclose with quotes (silgle or double) ...  for example, these are the configurations i have

Quote

'text/html; charset=UTF-8' .html
'text/html; charset=UTF-8' .htm
'text/html; charset=UTF-8' .php
'text/plain; charset=UTF-8' .txt

of course, for this to work you must ensure save your files with utf-8 encoding, or set mime types and files encoding accordingly (i like utf-8)...  a little issue is plesk lowercases all characters, turning UTF-8 into utf-8 ... dont know if is non-standard, but pages seem to work ok

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...