Is there any built-in Encoding Enum in C#? -


i have function receive encoding object parameter. however, think easier other programmers pass enum value instead of encoding object (especially programmers not use deal different encoding). couldn't find built-in encoding enum in c#... did miss or should create enum of own?

the idea of using enum programmer may not know different encoding objects

go principle of least astonishment. developers want alter encoding, know (or @ least, need to know) doing, , ought know how obtain encoding instance representing encoding want use.

if don't, can search web ".net encoding codepage xyz", directing them msdn page encoding.getencoding(). whereas if introduce new enum, google search ".net theblacksmurf.encodingenum codepage xyz" yield 0 results.

don't cater people don't know doing.

if instead you're going use enumeration, chances 1 developer does want change encoding , knows 1 use , how obtain it, can't utilize because didn't think of 1 , didn't include in enum.

on other hand, enum might viable solution, if whatever reason software can support handful of encodings.


Comments

Popular posts from this blog

xcode - CocoaPod Storyboard error: -

c# - AutoMapper - What's difference between Condition and PreCondition -