1 2 3 4 5 6 7 8 9 10 11 12 13 14 | // BOM 추출하기 System.IO.FileStream fs = System.IO.File.OpenRead(xmlFilePath); byte[] byteOrderMark = new byte[3]; fs.Read(byteOrderMark, 0, 3); if (byteOrderMark[0] == 0xEF && byteOrderMark[1] == 0xBB && byteOrderMark[2] == 0xBF) { // utf-8 } else if (byteOrderMark[0] == 0xFF && byteOrderMark[0] == 0xFE) { // utf-16 } | cs |
'Languages > C#' 카테고리의 다른 글
[C#] Internal Property 접근하기 (0) | 2016.03.23 |
---|---|
[C#] InputBox 만들기 (0) | 2014.01.21 |