Set default encoding to UTF-8 using Apache
Question:
How to set default encoding to UTF-8 using Apache? Answer:
AddDefaultCharset utf-8
Description:
The AddDefaultCharset
directive specifies a default value for the media type charset parameter (the name of a character encoding) to be added to a response if and only if the response's content-type
is either text/plain
or text/html
. This should override any charset specified in the body of the response via a META
element, though the exact behavior is often dependent on the user's client configuration.
The AddDefaultCharset
should only be used when all of the text resources to which it applies are known to be in that character encoding and it is too inconvenient to label their charset individually.
Reference:
The AddDefaultCharset reference
Share "How to set default encoding to UTF-8 using Apache?"
Related snippets:
- Change default terminal in VS Code
- Change colors in VS Code integrated terminal
- Change file encoding in VS Code
- Setup HTTPS for local development on Windows 10
- Add cookie in Chrome
- Setup xdebug 3 debugger for PHP
- Set default encoding to UTF-8 using Apache
- Enable compression in Apache using htaccess
- Cache static content using htaccess
- Redirect all requests to index.php using htaccess
- Set X-Frame-Options on Apache webservers
- Redirect www to non-www on Apache webservers
- Automatically redirect HTTP to HTTPS on Apache webservers
- Set X-Content-Type-Options in Apache
Tags:
change default encoding, apache set default encoding, content encoding, utf-8, apache, htaccess Technical term:
Set default encoding to UTF-8 using Apache