title: Unicode value \uXXXX to Character in Javascript
body: <p>I've never done this before and am not sure why it's outputting the infamous <code>�</code> encoding character.  Any ideas on how to output characters as they should (ASCII+Unicode)?  I think <code>\u0041</code>-<code>\u005A</code> should print <code>A-Z</code> in UTF-8, which Firefox is reporting is the page encoding.</p>
  
  <pre><code>   var c   = new Array("F","E","D","C","B","A",9,8,7,6,5,4,3,2,1,0);
     var n   = 0;
     var d   = "";
     var o   = "";
  
     for (var i=16;i--;){
        for (var j=16;j--;){
           for (var k=16;k--;){
              for (var l=16;l--;){
  
                 d =  c[i].toString()
                   +  c[j].toString()
                   +  c[k].toString()
                   +  c[l].toString();
  
                 o += ( ++n + ": " 
                      + d   + " = " 
                      + String.fromCharCode("\\u" + d) 
                      + "\n&lt;br /&gt;" );
  
                 if(n&gt;=500){i=j=k=l=0;} // stop early
              }
           }
        }
     }
  
     document.write(o);
  </code></pre>