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]