By default, Red Hat Enterprise Linux 4 sets the default character set in Apache to UTF-8. Your specific web application may need for the character set to be set to a different value, and the change can be made fairly easily. Here’s an example where the character set is changed to ISO-8859-1:
First, adjust the AddDefaultCharset directive in /etc/httpd/conf/httpd.conf:
#AddDefaultCharset UTF-8
AddDefaultCharset ISO-8859-1
Then, reload Apache and check your headers:
# /etc/init.d/httpd reload
# curl -I localhost
HTTP/1.1 403 Forbidden
Date: Thu, 08 Nov 2007 22:18:14 GMT
Server: Apache/2.0.52 (Red Hat)
Accept-Ranges: bytes
Content-Length: 3985
Connection: close
Content-Type: text/html; charset=ISO-8859-1
This was tested on Red Hat Enterprise Linux 4 Update 5
this was done because of the issues with MySQL within RHEL4 prior to that update.
See:
https://wiki.intra.rackspace.com/kwiki/index.cgi?MySQLhttpCharacterConfig
Basically MySQLs global.character_set_results was ISO-8859-1 whereas httpd was UTF-8
RHEL3, 2.1 and whatever else is ISO-8859-1 for httpd.
Basically the website page encoding (if not set, AddDefaultCharset in httpd.conf) MUST match character_set_results for MySQL!!!!
hi, i have a situation;
in my server:
export | grep LANG
response is:
declare -x LANG=”en_US.UTF-8
in httpd.conf:
#AddDefaultCharset UTF-8
(so there is no charset definition…)
i am using Plesk over Centos 5 (2.6.18-194.32.1.el5) i386, but one of my web site debug says:
“Server charset Encoding: You must set a correct charset encoding in your locale definition in the form: en_us.UTF-8. Please refer to setlocale man page. Detected locale: C (using UTF-8) ”
so here is the question:
can i edit/change only one vhosts httpd.conf’s Charset?…
I have to to add AddDefaultCharset UTF-8 in my httpd.conf
Is there any specific position (line number)to add in httpd.conf
Hi,
I crawl Vietnamese websites in VPS (Centos). (Example for Vietnamese: Đây là tiếng Việt), sometimes the result is correct, sometimes the result is wrong, the text is broken.
Correct:
- Sản phẩm được phối hợp 3 chủng vi khuẩn trong họ Lactobacillus rất có lợi cho đường ruột. Với hàm lượng vi khuẩn lớn và dạng đông khô nên khả năng sống bảo tồn lâu khi được bảo quản ở nhiệt độ thường. các chủng vi sinh vật này sẽ giúp cân bằng hệ thống vi khuẩn có ích trong đường ruột, giúp thúc đẩy quá trình tiêu hoá và hấp thu dinh dưỡng.
- Nâng cao sức đề kháng của cơ thể, đặc biệt giúp tăng cường khả năng tiêu hoá và hấp thu tốt các chất bổ dưỡng cho trẻ em nhờ bổ sung một số vitamin nhóm B và PP.
Wrong:
- Sản phẩm ÄÆ°á»£c phá»i hợp 3 chá»§ng vi khuẩn trong há» Lactobacillus rất có lợi cho ÄÆ°á»ng ruá»t. Vá»i hà m lượng vi khuẩn lá»n và dạng Äông khô nên khả nÄng sá»ng bảo tá»n lâu khi ÄÆ°á»£c bảo quản á» nhiá»t Äá» thưá»ng. các chá»§ng vi sinh váºt nà y sẽ giúp cân bằng há» thá»ng vi khuẩn có Ãch trong ÄÆ°á»ng ruá»t, giúp thúc Äẩy quá trình tiêu hoá và hấp thu dinh dưỡng.
- Nâng cao sức Äá» kháng cá»§a cÆ¡ thá», Äặc biá»t giúp tÄng cưá»ng khả nÄng tiêu hoá và hấp thu tá»t các chất bá» dưỡng cho trẻ em nhá» bá» sung má»t sá» vitamin nhóm B và PP.
But when I crawl these websites in XAMPP + Windows7 (for demo). All are correct!
I use Drupal (with Feeds, Feeds Crawler modules), but I think, the error does not come form Drupal.
Please see more information here: http://drupal.org/node/1916100
Do you have any idea about this?
Many thanks