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]
Public Shared Function ByteEncoding (
   data As Byte(),
   direction As Cnv.EncodingConversion 
) As Byte()

Parameters

data  Byte
Input data to be converted
direction  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-26 D.I. Management Services Pty Ltd t/a CryptoSys. All rights reserved. Generated 2026-09-17T11:18:15Z.