Bug 9427 - bad negotiation when started with LANG=cs_CZ
Summary: bad negotiation when started with LANG=cs_CZ
Status: CLOSED DUPLICATE of bug 17564
Alias: None
Product: Apache httpd-1.3
Classification: Unclassified
Component: Other mods (show other bugs)
Version: HEAD
Hardware: All Linux
: P3 minor (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
Depends on:
Reported: 2002-05-26 19:19 UTC by Stanislav Brabec
Modified: 2004-11-16 19:05 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Stanislav Brabec 2002-05-26 19:19:19 UTC
MultiViews does not properly negotiate documents for Mozilla, if apache is
started with cs_CZ locale. Expected reason of this bug is fact that decimal
point for Czech is ",", an so "q=0.66" cannot be properly parsed by scanf.

HTTP_ACCEPT_CHARSET="ISO-8859-2, utf-8;q=0.66, *;q=0.66"
Comment 1 William A. Rowe Jr. 2002-05-26 22:08:44 UTC
  One does not have the luxury of choosing local decimal semantics for
  RFC 2616, they are very clearly defined as an ascii '.'.  You could use
  a utility such as netcat (nc) to listen to a port, e.g. 8080, and then
  use the suspect browser to request a page.  NC will report the headers
  transmitted by the browser, proving or disproving your suspicions.
Comment 2 Stanislav Brabec 2002-05-27 16:15:55 UTC
The problem is not browser, but Apache.
New Mozilla generates:
HTTP_ACCEPT_LANGUAGE="cs, sk;q=0.80, en;q=0.60, ru;q=0.40, de;q=0.20"

This is not parsable with Apache started with Czech locale, because it expects
"," in numbers.
If I do:
apachectl stop
LC_ALL=C apachectl start
everything works OK, but with
LC_ALL=cs_CZ apachectl start
apache does not work properly for example on initial page of freshly installed
apache (Czech locale is not only locale with decadic comma problem).

The fix is simple set setlocale(LC_NUMERIC, "C") or something similar to proper
place of Apache (I did not found proper place) or not to set locale at all.

Off Topic:
There is a small fix to Czech locale (with no relation with this bug, but can be
easilly fixed by anybody with write access to Apache repository):
Czech locale is oficially called cs_CZ (language Czech = cs, country Czech
Republic = CZ) since 1994, but Apache still uses cz as language code. It should
be fixed at following places:
conf/httpd.conf-dist: s/cz/cs/g
mv htdocs/index.html.cz htdocs/index.html.cs
Comment 3 André Malo 2003-05-13 00:55:20 UTC
Well, the language code is fixed in 2.1 and proposed for backport.
A mod_negotiation patch was also applied some time ago to 2.1, but there's still
an outstanding discussion about some details.

Although your report is much older, I'll mark this one as duplicate.

Thanks for your report and thanks for using Apache.

*** This bug has been marked as a duplicate of 17564 ***