posted by 네코냥이 2014. 1. 2. 13:16


You can use encoding like ASCII to get a character per byte by using the System.Text.Encoding class.

or try this

  System.Text.ASCIIEncoding.Unicode.GetByteCount(string);
  System.Text.ASCIIEncoding.ASCII.GetByteCount(string);

익명의 제보
=> 인코딩 직접 지정.
public static readonly Encoding euckr = Encoding.GetEncoding("EUC-KR");
euckr.GetByteCount(string);


'.NET > C#' 카테고리의 다른 글

[C#] Read only and const variable  (0) 2014.01.06
[C#] Ref and Out Parameters  (0) 2014.01.06
[C#] 정규식  (0) 2013.11.06
[C#] [스크랩] C# - JSON for .NET  (0) 2013.10.11
[스크랩] [C#] HTTP/HTTPS 송수신 (HttpWebRequest/HttpWebResponse)  (0) 2013.10.11