Q:

String comparison of Japanese characters

I need two compare to strings to see if they are the same value, both strings are in Japanese. This check seems to fail and I assume it's some shortcoming of JavaScript and UTF-8. Should it be expected for this to succeed? And how can I make it work? Can JavaScript convert to strings like \x{57fc} to perform comparison on?
var foo = '郵便番号',
    bar = '郵便番号';

if(foo == bar){
    console.log('they are the same');
}

UPDATE
It appears this actually works just fine, the failure is a bigger issue with backbone validation. Thanks for the answers.

A:

You forgot the quotes on your strings!
Run your current code with the browser console open, and you'll see a ReferenceError due to the missing quotes (the interpreter will think 郵便番号 is an identifier, not a string).
Wrap your strings in proper quotes, and it just works, JavaScript can handle UTF-8 just fine:
var foo = '郵便番号',
    bar = '郵便番号';

if(foo == bar){
    console.log('they are the same');
}

Regarding your second question, you can use '\u57fc', but usually you don't need to; it's the same as a literal '埼'.

