File encoding information

Dec 16, 2013 at 9:14 PM
I have created rule to check if file is in specific encoding (e.g. UTF-8).

I get the file path from CodeDocument.SourceCode.Path and the method Utils.GetFileEncoding() gives me encoding of this file.

But this method open the file and read from it... it's unnecessary because if we open file to analyze StyleCop it's self use this method (CodeFile.cs).

I was wandering can you make public property with Encoding in SoruceCode, and in the method Read() store this information in this property.

My rule will work much faster without opening and reading the file again...
Coordinator
Dec 16, 2013 at 10:05 PM
Yes.

Makes sense.

Add it as a work item please and I'll do it.


~Andy.

Marked as answer by Carnifex on 12/16/2013 at 11:52 PM
Dec 17, 2013 at 6:52 AM
Ok, I created some... but don't know if this is proper way :)
https://stylecop.codeplex.com/workitem/7596

I couldn't select any "type" for it...