• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question Nginx not use charset UTF-8 for xml...?

Azurel

Silver Pleskian
Server operating system version
AlmaLinux 8.8 (Sapphire Caracal)
Plesk version and microupdate number
Plesk Obsidian Version 18.0.53 Update #2
I verified a XML file with w3.org and get back:
This feed is valid, but interoperability with the widest range of feed readers could be improved by implementing the following recommendations.
Your feed appears to be encoded as "UTF-8", but your server is reporting "US-ASCII"

XML files are served by nginx and not in utf-8? What with Javascript? How I can change that in plesk?
 
That's something you define in your XML file. Like:

XML:
<?xml version = "1.0" encoding = "UTF-8" standalone = "no" ?>
 
This is what the line says. In the file utf8 is specified (with encoding="UTF-8"), but the XML-file is sent as charset US-ASCII.
 
Content-Encoding: br
Content-Type: text/xml
Date: Wed, 19 Jul 2023 08:24:21 GMT
Etag: W/"64b6f061-6009"
Last-Modified: Tue, 18 Jul 2023 20:04:49 GMT
Server: nginx
Vary: Accept-Encoding

another servers response here with
Content-Type: application/xml; charset=UTF-8
 
So, you need to fix the Content-Type header. You can use something like AddCharset UTF-8 .xml in Apache config (e.g. in .htaccess) if you have Apache behind nginx or charset utf-8; in nginx configs.
 
Not all documents in the world are in UTF-8, so forcing that on web server level by default is risky.
 
Back
Top