Convert encoding of byte array between UTF-8 and Latin-1.
Namespace: CryptoSysPKIAssembly: diCrSysPKINet (in diCrSysPKINet.dll) Version: 23.0.0.30549 (23.1.0.0)
Syntaxpublic static byte[] ByteEncoding(
byte[] data,
CnvEncodingConversion direction
)
Public Shared Function ByteEncoding (
data As Byte(),
direction As CnvEncodingConversion
) As Byte()
Parameters
- data Byte
- Input data to be converted
- direction CnvEncodingConversion
- Direction of conversion
Return Value
ByteConverted 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