Allocates and returns a wide UCS-2 (UCS-4) copy of a multibyte UTF-8 string.
- Parameters
-
[in] | pszRight | is a pointer to an input multibyte string. The string need not to be zero-terminated if cbRight specifies its actual size in bytes. On the contrary cbRight can be (size_t) -1, in which case pszRight must be zero-terminated. If a zero-terminator is found among first cbRight bytes of the input string the conversion stops and the last part of the input string is ignored. The terminator is converted and written to the output buffer returned by the function. |
[in] | cbRight | may explicitly specify a length of the input multibyte string in bytes. Or it can be (size_t) -1 in which case the length of the input must be given by the zero-terminating character. |
- Returns
- The function returns an allocated buffer containing the converted zero-terminated wide string. If an error occurs the function returns NULL and sets corresponding chsvlib error code. The allocated string should be deallocated by FreeStringW function or by any other freeing function defined in chsvmem.h.
- See also
- FreeStringW;
AllocateAndFormatStringW;
AllocateUTF8FromUCS;
ConvertUCSToUTF8.