CryptoSys PKI Pro Manual

Cnv.CheckUTF8File Method

Check that a file contains only valid UTF-8 encoded characters.

Syntax

[C#]
public static int CheckUTF8File(
   string fileName 
)
[VB]
Public Shared Function CheckUTF8File (
   fileName As String 
) As Integer

Parameters

fileName  String
name of file to check

Return Value

Zero 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:

Return valueDescription
0Not valid UTF-8
1Valid UTF-8, all chars are 7-bit ASCII
2Valid UTF-8, contains at least one multi-byte character equivalent to 8-bit ANSI
3Valid 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

VB6/C equivalent: CNV_CheckUTF8File

[Contents] [Index]

[PREV: Cnv.CheckUTF8 Method...]   [Contents]   [Index]   
   [NEXT: Cnv.FromBase58 Method...]

Copyright © 2004-26 D.I. Management Services Pty Ltd t/a CryptoSys. All rights reserved. Generated 2026-09-17T11:18:15Z.