2

I think I have configured ISO-8859-1 at all necessary locations, but still, my pages are displaying black '?' instead of German umlauts! My server runs Plesk 17.8.11 / Debian 8 / Apache 2 / PHP 7.1 (FPM).

Plesk > Websites & Domains > mysite.com > PHP Settings:
    Additional configuration directives:
       default_charset = "iso-8859-1"
Plesk > Websites & Domains > mysite.com > Apache & nginx Settings:
    Additional directives for HTTP:
       AddDefaultCharset ISO-8859-1
    Additional directives for HTTPS:
       AddDefaultCharset ISO-8859-1
    Additional nginx directives:
       charset iso-8859-1;

/etc/apache2/apache2.conf:
    AddDefaultCharset iso-8859-1
/etc/php5/fpm/php.ini:
    default_charset = "iso-8859-1"
/etc/php5/apache2/php.ini:
    default_charset = "iso-8859-1"

.htaccess in the root directory of the affected domain contains:
    AddDefaultCharset ISO-8859-1

I hope it is okay to reference one of the affected URLs here to allow checking the source and encoding of the page: https://www.psychotherapiepraxis.at/gute_therapie.phtml

All page content is saved in .html files, so the pages' html code isn't retrieved from a database.

Any idea what might be the culprit?

richey
  • 121
  • 2
  • 3
    Sorry but why not UTF-8 everywhere? – 炸鱼薯条德里克 Sep 09 '18 at 00:59
  • 1
    because every html page contains 50-150 umlauts (not using the character entity codes like ö , but plain-written umlauts like 'ö'), and there are hundreds of pages.. – richey Sep 09 '18 at 01:16
  • 1
    Use a script to fix them. Python can do that, transform encoding and fix HTML headers. Or change your browser settings of clients to display content using iso8859_1. – 炸鱼薯条德里克 Sep 09 '18 at 01:44
  • 2
    I'll second the "do everything in UTF-8" comment. Having a different encoding will only cause you pain in the long run. Another option instead of a custom script is `iconv`. – dirkt Sep 09 '18 at 05:35
  • 1
    Another UTF-8 advocate: This is the 21st century: all OSes running nowadays can interpret Unicode: you're using 1990s technology. (Entschuldiging aber äëïöü und auck ÿ sind perfekt möglich mit UTF-8) – Fabby Sep 09 '18 at 06:52
  • thanks for your feedback - my pages are basically long articles, and I like to be able to read, update and correct them in 'readable' format (including umlauts instead of HTML codes). Is there a way to use umlauts in the text body but still have the page displayed okay if the server 'insists' of delivering UTF-8? – richey Sep 09 '18 at 08:09
  • ISO-8859-1 is the basic encoding for Central Europe as is 7-bit ASCII for the US. BTW: the low 256 characters in UNICODE are identical to ISO-8859-1 and if UTF-8 did use a better coding/handling there was a better UTF-8 acceptance. People who belive that UTF-8 does not cause problems usually live in the US and only use the low 128 characters and for that reason de-facto still use 7-bit ASCII. – schily Sep 09 '18 at 09:04
  • @richey How do you edit the pages? Do you write html in an editor? If so, there is probably a setting in the editor for it to use UTF-8. Likewise for any other tool, like a content management system or dedicated off-line web page editing program. – Johan Myréen Sep 09 '18 at 09:38

1 Answers1

0

I'm frustrated that Plesk - that is meant to support webmasters - doesn't offer a meaningless way to effectively set the encoding of a site's pages, in order to get this to work.

I just batch-converted all of my pages to UTF-8 using this very helpful answer:

https://stackoverflow.com/questions/44157064/need-to-batch-convert-a-large-quantity-of-text-files-from-ansi-to-unicode and pages display correctly now.

Rui F Ribeiro
  • 55,929
  • 26
  • 146
  • 227
richey
  • 121
  • 2