Encode any JavaScript with only six characters
utf-8.jp
utf-8.jp
Here's a dictionary/more information: http://sla.ckers.org/forum/read.php?24,33349,33405
-- Yosuke HASEGAWA / utf-8.jp
The other demos seem to work much better though: http://utf-8.jp/public/jjencode.html
TypeError: Array.prototype.sort called on null or undefined.
I would be interested to see what exactly it's doing, and how alert("Hello World"); gets mangled to call Array.prototype.sort().EDIT: I should note that I get this error no matter what code I put in. I think Chrome's Javascript interpreter is somehow interpreting some of that boilerplate as a call to Array.prototype.sort() somehow.
For example, `+[]` equals the integer 0 (apparently the unary plus operator coerces the empty array to a boolean then converts to an integer), and `![]` of course equals the boolean false. Furthermore, JavaScript does some weird type coercion, so `false + []` equals the string "false". Replace the boolean false with `![]`, so `![] + []` equals the string "false". Now, if we need the letter "f" we just do `"false"[0]`, encoded as `(![] + [])[+[]]`. Remove spaces, and you can see that `(![]+[])[+[]]` is equivalent to "f".
People have figured out how to get tons of characters from small initial character sets. See this: http://sla.ckers.org/forum/read.php?24,33349,33405