CryptoSys PKI Pro Manual

Cnv.ByteEncoding Method

Convert encoding of byte array between UTF-8 and Latin-1.

Syntax

[C#]
public static byte[] ByteEncoding(
	byte[] data,
	Cnv.EncodingConversion direction
)
[VB.NET]
Public Shared Function ByteEncoding ( _
	data As Byte(), _
	direction As Cnv.EncodingConversion _
) As Byte()

Parameters

data
Input data to be converted
direction
Type: Cnv.EncodingConversion
Direction of conversion

Return Value

Converted data (or empty array on error)

Remarks

Converting UTF-8 from Latin-1 assumes the input is from the 8-bit Latin-1 character set and so will always produce output that is valid UTF-8. However, for Latin-1 from UTF-8, the input must contain a valid sequence of UTF-8-encoded bytes and this must be convertible to a single-byte character set, or an error will be returned.

See Also

VB6/C equivalent: CNV_ByteEncoding

[Contents] [Index]

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

Copyright © 2004-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-09-23T07:52:09Z.