Click or drag to resize

CnvByteEncoding Method

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

Namespace: CryptoSysPKI
Assembly: diCrSysPKINet (in diCrSysPKINet.dll) Version: 23.0.0.30549 (23.1.0.0)
Syntax
public static byte[] ByteEncoding(
	byte[] data,
	CnvEncodingConversion direction
)

Parameters

data  Byte
Input data to be converted
direction  CnvEncodingConversion
Direction of conversion

Return Value

Byte
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