CryptoSys PKI Toolkit Manual

Cnv.CheckUTF8 Method

Checks that a string contains only valid UTF-8 encoded characters

Syntax

[C#]
public static int CheckUTF8(
	string s
)
[VB.NET]
Public Shared Function CheckUTF8 ( _
	s As String _
) As Integer

Parameters

s
input string to check

Return Value

Zero if the string is invalid UTF-8, or a positive number if the string is valid UTF-8, where the value of the number indicates the nature of the encoded characters:

0Not valid UTF-8
1Valid UTF-8, all chars are 7-bit ASCII
2Valid UTF-8, contains at least one 8-bit ANSI character
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.

[Contents] [Index]

[HOME]   [NEXT: Cnv.FromHex Method...]

Copyright © 2004-10 D.I. Management Services Pty Ltd. All rights reserved.