47

Possible Duplicate:
What is the _snowman param in Ruby on Rails 3 forms for?

If you inspect the POST parameters of Gmail login with Firebug or Chrome developer tools, you'll see a _utf8 parameter with a value of :

_utf8:☃

(See the attached image in case your browser doesn't render the value. It's a snowman, U+2603, http://www.utf8-character.info/#!%E2%98%83.)

Why do they do this? Is it possible that they somehow test for browser compatibility to UTF-8?

Enter image description here

Community
  • 1
  • 1
cherouvim
  • 31,725
  • 15
  • 104
  • 153
  • 1
    bro it's 2012 get a stronger password also change ALL you other accounts on the internet that have also have that password – Letseatlunch Dec 11 '12 at 22:37
  • 5
    @Letseatlunch: Thanks for the advice. As you can see I went into the trouble of bluring the possibly sensitive parts of the request. If you think that I left out my real email and password... well... think again. – cherouvim Dec 12 '12 at 05:51

1 Answers1

47

The _utf8 header along with a Unicode character is to ensure that

  1. At least one Unicode character is submitted to the server
  2. Force certain non-compliant browsers to respect the form's character encoding

In some cases, the _utf8 header is given a value of a ☃ and sometimes it is a ✓. What it is doesn't really matter and may have arbitrarily been chosen for fun.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Mizuki Oshiro
  • 486
  • 5
  • 5
  • Why do they care to submit at least one unicode character to the server? What difference does it make? – cherouvim Dec 10 '12 at 08:45
  • 5
    cherouvim: It may be to ensure that the rest is unicode as well (for instance on old version of IE) rather than some other local encoding. – p4bl0 Dec 10 '12 at 09:43
  • 3
    Originally in Rails it was a snowman, then they made it a checkmark. It's to force IE to interpret the entire form submission as UTF-8, which it will not do otherwise. – Steve Hill Dec 10 '12 at 12:16
  • @StephenOrr: Which versions of IE? – Janus Troelsen Dec 10 '12 at 12:32
  • 1
    @JanusTroelsen Not sure, and I can't find any definitive answers. I suspect IE6 and below though. This is just what I remember from the discussions going on when the snowman character was originally added. – Steve Hill Dec 10 '12 at 13:57
  • Therefore, IE sucks! Don't use it! – Alex Bitek Dec 10 '12 at 21:47