Javascript中LenB的计算(ASP)
<%
'==========================================================
'機能 :LenB
'==========================================================
Sub gsPutJsLenB()
%>
function fLenB(character) {
var count = 0;
for (var i = 0; i < character.length; i++) {
if ((character.charCodeAt(i) > 0 && character.charCodeAt(i) < 127 )
|| (character.charCodeAt(i) > 65376 && character.charCodeAt(i) < 65440)){
count++;
} else {
count += 2;
}
}
return count;
}
<%
End Sub
%><% End Sub %>