FileInfoExtensionIsUtf8Valid Method
Tests whether the portion of the file specified by fileInfo that extends at least count characters from the beginning
of the file represents valid UTF-8.
Namespace: FolkerKinzel.StringsAssembly: FolkerKinzel.Strings (in FolkerKinzel.Strings.dll) Version: 9.4.0+10a7d4d71aa960998e32ac0ac6c4fcbe4164c917
public static bool IsUtf8Valid(
this FileInfo fileInfo,
int count = -1
)
<ExtensionAttribute>
Public Shared Function IsUtf8Valid (
fileInfo As FileInfo,
Optional count As Integer = -1
) As Boolean
public:
[ExtensionAttribute]
static bool IsUtf8Valid(
FileInfo^ fileInfo,
int count = -1
)
[<ExtensionAttribute>]
static member IsUtf8Valid :
fileInfo : FileInfo *
?count : int
(* Defaults:
let _count = defaultArg count -1
*)
-> bool
- fileInfo FileInfo
- A FileInfo object that references the file to
check.
- count Int32 (Optional)
- The minimum number of characters to check. If a negative number
is passed to the parameter (default) or if count is greater than
the length of the data in the specified file, the entire file is checked. The value
0 is not allowed.
Booleantrue if the checked file section represents valid UTF-8,
false
otherwise.In Visual Basic and C#, you can call this method as an instance method on any object of type
FileInfo. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).