AxSc
AxSc

Reputation: 636

HttpUtility.HtmlDecode on other server does not decode

I have german "Umlaute" in my database, saved as HTML entities -> ü => "#252;".

On my local server (IIS on Windows 7) decoding with HttpUtility.HtmlDecode() works perfectly but when I publish my application to my real webserver (IIS on Windows Server 2008 R2) the strings are not decoded and I see the HTML Entities.

Is there a configuration option?

Upvotes: 0

Views: 383

Answers (1)

usr
usr

Reputation: 171246

What you describe would be an egregious bug in HttpUtility.HtmlDecode which is extremely unlikely. For debugging purposes, add to your page:

<%: HttpUtility.HtmlDecode("&#252;") %>

And you'll see that it works fine. The bug that your application has is somewhere else. Can't tell where with the given information. Probably, you just pass in unexpected data.

Is there a configuration option?

There is no setting "DisableHtmlDecodeBugs" if that's what you mean...


And on 2nd look I see that your entity syntax is just wrong. #252; should be &#252;. As I said, assume that HttpUtility.HtmlDecode has no bugs.

Upvotes: 1

Related Questions