title: Does the enableClientBasedCulture attribute in Web.config work at all?
body: <p>Searching the web, I am seeing plenty of instances where the following combination of attributes is used in the globalization section: culture="auto", uiCulture="auto", enableClientBasedCulture="true", e.g.:</p>
  
  <pre><code>&lt;globalization uiCulture="auto" culture="auto" requestEncoding="utf-8" responseEncoding="utf-8" enableClientBasedCulture="true"/&gt;
  </code></pre>
  
  <p>The documentation says: <a href="http://msdn.microsoft.com/en-us/library/system.web.configuration.globalizationsection.enableclientbasedculture(v=VS.90).aspx">http://msdn.microsoft.com/en-us/library/system.web.configuration.globalizationsection.enableclientbasedculture(v=VS.90).aspx</a></p>
  
  <blockquote>
    <p>When the EnableClientBasedCulture property is enabled, the Culture and
    UICulture properties are based on the AcceptLanguage header field
    value that is sent by the client browser. If the AcceptLanguage header
    value cannot be mapped to a specific culture, the Culture and
    UICulture values are used. The default value is false.</p>
  </blockquote>
  
  <p>For the culture and uiCulture attributes, "auto" is supposed to mean <a href="http://msdn.microsoft.com/en-us/library/bz9tc508(v=VS.90).aspx">http://msdn.microsoft.com/en-us/library/bz9tc508(v=VS.90).aspx</a></p>
  
  <blockquote>
    <p>To have ASP.NET set the UI culture and culture to the first language
    that is specified in the current browser settings, set UICulture and
    Culture to auto. Alternatively, you can set this value to
    auto:culture_info_name, where culture_info_name is a culture name. For
    a list of culture names, see CultureInfo. You can make this setting
    either in the @ Page directive or Web.config file.</p>
  </blockquote>
  
  <p>Suppose the browser sends an invalid or no culture name in the AcceptLanguage header field value. Because enableClientBasedCulture="true", the application server is supposed to attempt to use whatever is in the AcceptLanguage header field, but with an invalid culture name, it fails to do so and falls back on culture="auto" and uiCulture="auto", but the auto/auto settings themselves will fail to make any use of the invalid data.</p>
  
  <p>Now suppose we do send the server a valid culture name, e.g. "de-DE". The application server is still told to make use of the AcceptLanguage header field value because enableClientBasedCulture="true", but since culture and uiCulture are set to "auto", they would have made use of that value anyway.</p>
  
  <p><strong>My first question is</strong>: What is the point in combining auto/auto with true? My own belief is that if culture="auto" and uiCulture="auto", using enableClientBasedCulture="true" would be redundant. My own tests have shown that auto/auto works just as well alone as they do when combined with the enableClientBasedCulture attribute, but as I am seeing the auto/auto/true combination being suggested in many examples on the web, I am wondering if I have overlooked something.</p>
  
  <p>I have tried using enableClientBasedCulture="true" without the auto/auto settings, e.g.</p>
  
  <pre><code>&lt;globalization requestEncoding="utf-8" responseEncoding="utf-8" enableClientBasedCulture="true"/&gt;
  </code></pre>
  
  <p>This does not seem to work at all; it appears that the client is force-fed the 
  server's culture and uiCulture settings, even though enableClientBasedCulture="true" is supposed to (implicitly?) take care of setting those properties to that of the AcceptLanguage header field value.</p>
  
  <p>I then tried combining enableClientBasedCulture with a specific culture for culture and uiCulture, e.g.</p>
  
  <pre><code>&lt;globalization uiCulture="da-DK" culture="da-DK" requestEncoding="utf-8" responseEncoding="utf-8" enableClientBasedCulture="true"/&gt;
  </code></pre>
  
  <p>In this case, the client browser was forced to use "da-DK", regardless of its language settings.</p>
  
  <p>Looking at <a href="http://msdn.microsoft.com/en-us/library/hy4kkhe0(v=VS.90).aspx">http://msdn.microsoft.com/en-us/library/hy4kkhe0(v=VS.90).aspx</a> I see this for enableClientBasedCulture:</p>
  
  <blockquote>
    <p>This attribute is not in use at this time.</p>
  </blockquote>
  
  <p>Using .NET Reflector, I have decompiled all of the .NET 3.5 Framework assemblies and searched for enabledClientBasedCulture. I have found some code in System.Web.Configuration\GlobalizationSection that reads the value and makes it available through a property, but otherwise does nothing with it.</p>
  
  <p>In Hosting\HostingEnvironment I find a method named SetCultures which grabs the culture and uiCulture values from a GlobalizationSection parameter, but I have yet to find any code that makes use of the enableClientBasedCulture attribute.</p>
  
  <p><strong>So my second question is</strong>: Is the enableClientBasedCulture attribute actually being used anywhere at all and if so, how should I configure a test program in order to prove to myself that it has any effect?</p>