2
if (bom[0] == 0xef && bom[1] == 0xbb && bom[2] == 0xbf) // BOM Check 
{
    encodingType = Encoding.UTF8;// UTF8  Returns
}

I saved file as UTF8 Encoding, But this part is being skipped always

3
  • See also: stackoverflow.com/questions/13235189/… Commented Mar 3, 2017 at 7:43
  • I think that is not specific for any C# code.@Corak Commented Mar 3, 2017 at 9:14
  • What kind of file do you save using UTF-8 encoding? CSV? And how do you do this? Hint: For UTF-8 the BOM is not required. So most programs will not put a BOM there by default. Commented Mar 3, 2017 at 9:29

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.