views:

360

answers:

2

In a Microsoft Security Document, in the Code Review section ( http://msdn.microsoft.com/en-us/library/aa302437.aspx ), it suggests setting the globalization.requestEncoding and globalization.responseEncoding to "ISO-8859-1" opposed to "UTF-8" or another Unicode format.

What are the downsides to using "ISO-8859-1", in the past I've set both to UTF-8 for maximum compatibility.

+2  A: 

The downside is that it's not as compatible. In fact, there are lots of reasons not to use anything but UTF-8.

I looked at that doc page and I'm not sure it's actually suggesting to use Latin1 - I think it might just be using that as an example.

The HttpUtility encoding methods all use UTF-8 by default, so unless you really didn't want international characters coming in with your inputs, I don't see any reason to set it to Latin-1.

womp
Agreed and good article reference.
Josh
A: 

That page doesn't seem to recommend ISO-8859-1 specifically, all it says is:

"To help prevent attackers using canonicalization and multi-byte escape sequences to trick your input validation routines, check that the character encoding is set correctly to limit the way in which input can be represented."

Also, on another page it says "Both approaches are shown below using the ISO-8859-1 character encoding, which is the default in early versions of HTML and HTTP"

Greg