Converts UTF-8 encoded array of bytes into a Latin-1 string, if possible.
Public Declare Function CNV_Latin1FromUTF8Bytes Lib "diCrPKI.dll" (ByVal strOutput As String, ByVal nOutChars As Long, ByRef abInput As Byte, ByVal nBytes As Long) As Long
nLen = CNV_Latin1FromUTF8Bytes(strOutput, nOutChars, abInput(0), nBytes)
String to receive the output.Long specifying the maximum number of characters to be received.Byte array containing UTF-8 encoded data.Long number of bytes in input array.
long _stdcall CNV_Latin1FromUTF8Bytes(char *szOutput, long nOutChars, const char *lpInput, long nBytes);
Long: If successful, the return value is a positive number indicating the
number of characters (bytes) in the output string, or number of characters required if nOutChars is set to zero;
otherwise it returns a negative error code.
Use System.Text.Encoding.UTF8.GetString(bytes).
Will set up to nOutChars characters in the output string. If nOutChars is zero, it returns the required number of characters. The input must be valid UTF-8 data. Possible errors are INVALID_DATA_ERROR indicating invalid UTF-8 input and OUT_OF_RANGE_ERROR which indicates that the output would contain a character greater than 8 bits in size.
CNV_UTF8BytesFromLatin1 CNV_CheckUTF8Bytes CNV_ByteEncoding