Check that a file contains only valid UTF-8 encoded characters.
Namespace: CryptoSysPKIAssembly: diCrSysPKINet (in diCrSysPKINet.dll) Version: 23.0.0.30549 (23.1.0.0)
Syntaxpublic static int CheckUTF8File(
string fileName
)
Public Shared Function CheckUTF8File (
fileName As String
) As Integer
Parameters
- fileName String
- name of file to check
Return Value
Int32Zero if the encoded bytes is invalid UTF-8,
or a positive number if the input contains valid UTF-8 data, where the value of the
number indicates the nature of the encoded characters:
0 | Not valid UTF-8 |
1 | Valid UTF-8, all chars are 7-bit ASCII |
2 | Valid UTF-8, contains at least one multi-byte character equivalent to 8-bit ANSI |
3 | Valid UTF-8, contains at least one multi-byte character
that cannot be represented in a single-byte character set |
Remarks
'Overlong' UTF-8 sequences and illegal surrogates are rejected as invalid.
See Also