Server 2003 SP1 introduced "enableBestFitResponseEncoding" setting

Discussion in 'ASP .Net' started by =?Utf-8?B?VG9yc3RlbiBTdHVybQ==?=, Aug 31, 2005.

  1. Hello,

    SP1 of Windows Server introduced a new "feature" in the GlobalizationConfig
    class
    called EnableBestFitResponseEncoding.

    Effect is that when you set anything other than UTF8 in web.config, e.g.
    <globalization requestEncoding="iso-8859-1" responseEncoding="iso-8859-1" />,
    many functions will break (including HttpUtility.URLDecode) with a
    MethodNotImplementedExecption in the new internal class
    CodePageNoBestFitEncoding.

    Analyzing with the reflector reveals, that new code was added to the
    HttpResponse.ContentEncoding property:

    if (!this._encoding.Equals(Encoding.UTF8))
    {
    string text1 = this._encoding.GetType().FullName;
    if ((config1 == null) ||
    !config1.EnableBestFitResponseEncoding)
    {
    if (text1 ==
    "System.Text.MLangCodePageEncoding")
    {
    this._encoding =
    Encoding.GetEncoding("mlang");
    }
    else if ((text1 ==
    "System.Text.CodePageEncoding") || (text1 == "System.Text.Latin1Encoding"))
    {
    int num1 = this._encoding.CodePage;
    this._encoding = new
    CodePageNoBestFitEncoding(num1);
    }
    }

    Assuming that EnableBestFitResponseEncoding is false by default, this property
    will return a new instance of CodePageNoBestFitEncoding when you set a
    responseEncoding="iso-8859-1" in web.config.

    Many of the normal Encoding methods in CodePageNoBestFitEncoding will throw
    the MethodNotImplemented exception which explains the above mentioned
    bahavior.
    Some additional analysis reveals that there is a new attribute for
    <globalization > called "enableBestFitResponseEncoding". After setting this
    attribute
    to "true", everthing works again as normal with a responseEncoding other than
    UTF8.
    I did not find any documentation about this new attribute.
    Can anyone give us some hints ?

    Best Regards,
    Torsten Sturm
    hotel.de AG
    =?Utf-8?B?VG9yc3RlbiBTdHVybQ==?=, Aug 31, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeremy Holt
    Replies:
    0
    Views:
    475
    Jeremy Holt
    Apr 1, 2005
  2. =?Utf-8?B?RHIuIFBhdWwgQ2Flc2FyIC0gQ291bGxCeXRlIChV

    ASP.NET 1.1 VERSION ON WIN SERVER 2003 SP1 & VS 2003 Arch.

    =?Utf-8?B?RHIuIFBhdWwgQ2Flc2FyIC0gQ291bGxCeXRlIChV, Apr 30, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    583
    Aquila Deus
    Apr 30, 2005
  3. Seller
    Replies:
    12
    Views:
    740
    disegno piacevole, lavoro grande :) http://www.quk
    Mar 31, 2007
  4. Vijay
    Replies:
    1
    Views:
    303
    Joern Schou-Rode
    Nov 1, 2008
  5. Judy
    Replies:
    0
    Views:
    1,029
Loading...

Share This Page