Documentation Index
Fetch the complete documentation index at: https://notevil.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
ConvertString
Valid for: CANoe DE • CANoe:lite DE • CANoe4SW DE • CANoe4SW:lite DEFunction Syntax
Description
Converts a string from one encoding to another encoding. The length of the converted string depends on the requested encoding. The number of bytes used in the output byte array is written to encodedSize. If the size of the output array maxOutputSize is not sufficient to hold the converted string and a terminating “\0”, the function returns an error and the content of output is undefined. Characters that cannot be represented in the requested encoding are replaced with the best matching character, selected by the Windows functionWideCharToMultiByte.
Parameters
- output: Target byte array.
- encodedSize: ConvertString writes the number of bytes used in output (including the terminating “\0”) to this parameter.
- maxOutputSize: Size of the output array.
- outputCodepage: Windows code page number for output. The include file Encoding.cin defines the following code pages:
- CP_UTF8
- CP_UTF16
- CP_LATIN1
- CP_SHIFT_JIS
- input: The input string in encoding codepage, without BOM.
- inputSize: Length of the input string in bytes.
- inputCodepage: Windows code page number for input. The include file Encoding.cin defines the following code pages:
- CP_UTF8
- CP_UTF16
- CP_LATIN1
- CP_SHIFT_JIS
Return Values
- 0: Success, the byte array output and the resulting length encodedSize are valid.
- -1: Illegal character (e.g. illegal UTF8 code point).
- -2: Insufficient buffer space, output array is too small.
- -3: Internal error.