Add Auto UTF-8 encode

This commit is contained in:
An Phan 2015-02-01 12:27:27 +08:00
parent c6711a5986
commit 937cb0daec
1 changed files with 13 additions and 1 deletions

View File

@ -30,6 +30,7 @@ A collection of useful .htaccess, all in one place. I decided to create this rep
- [Custom Error Pages](#custom-error-pages)
- [Force Downloading](#force-downloading)
- [Allow Cross-Domain Fonts](#allow-cross-domain-fonts)
- [Auto UTF-8 Encode](#auto-utf-8-encode)
## Rewrite and Redirection
Note: It is assumed that you have `mod_rewrite` installed and enabled.
@ -304,4 +305,15 @@ CDN-served webfonts might not work in Firefox or IE due to [CORS](https://en.wik
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
</IfModule>
```
```
### Auto UTF-8 Encode
Your text content should always be UTF-8 encoded, no?
``` apacheconf
# Use UTF-8 encoding for anything served text/plain or text/html
AddDefaultCharset utf-8
# Force UTF-8 for a number of file formats
AddCharset utf-8 .atom .css .js .json .rss .vtt .xml
```
[Source](http://h5bp.com)