[]バイト数カウント(Shift_JIS EUC用)
IEの改行は、\r\nになる。
FFの改行は、\nになる。
function getByteCount(s) { var i=0; var nBytes=0; for(i=0;i<s.length;i++){ if(s.charAt(i)=='\n') nBytes++; else if(s.charAt(i)=='\r') ; //カウントしない else if( s.charCodeAt(i)>255 )nBytes+=2; else nBytes++; } return nBytes; }