To be more precise, I need to know whether (and if possible, how) I can find whether a given string has double byte characters or not. Basically, I need to open a pop-up to
Here is benchmark test: http://jsben.ch/NKjKd
This is much faster:
function containsNonLatinCodepoints(s) { return /[^\u0000-\u00ff]/.test(s); }
than this:
function isDoubleByte(str) { for (var i = 0, n = str.length; i < n; i++) { if (str.charCodeAt( i ) > 255) { return true; } } return false; }