'byte'에 해당되는 글 3건

  1. 2011.09.20 byte 수 체크
  2. 2009.09.17 byte check
  3. 2009.09.17 Byte Check

byte 수 체크

Windows/c# 2011. 9. 20. 18:01
 Encoding encKor = Encoding.GetEncoding("ks_c_5601-1987");                
Console.WriteLine(encKor.GetByteCount(inString));
Posted by 아로스

byte check

Windows/ASP 2009. 9. 17. 14:18
'------------------------------------------------------------------------------
'   Description : byte(바이트) 글자 체크
'------------------------------------------------------------------------------
function fn_ByteLen(str)
    tlen=0
    tt=len(str)
    k=1
    for i=1 to tt
        if asc(mid(str,k,1)) < 0 then
            tlen=tlen+2
        else
            tlen=tlen+1
        end if
        k=k+1
    next
    fn_ByteLen=tlen
end function
Posted by 아로스

Byte Check

Windows/JAVASCRIPT 2009. 9. 17. 14:17

function calculateBytes( szValue)
{
  var tcount = 0;

  var tmpStr = new String(szValue);
  var temp = tmpStr.length;

  var onechar;
  for ( k=0; k<temp; k++ )
  {
    onechar = tmpStr.charAt(k);
    if (escape(onechar).length > 4)
    {
      tcount += 2;
    }
    else
    {
      tcount += 1;
    }
  }

  return tcount;
}

Posted by 아로스
1

아로스

달력

05-05 08:07