From 794b8367d02710afaf05fff569fa3e7e16d9cf47 Mon Sep 17 00:00:00 2001 From: shermp <14854761+shermp@users.noreply.github.com> Date: Wed, 10 Apr 2019 20:33:08 +1200 Subject: [PATCH] Add comments to vhdstrenc.h --- vhdstrenc.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vhdstrenc.h b/vhdstrenc.h index 9676bc0..ae95eed 100644 --- a/vhdstrenc.h +++ b/vhdstrenc.h @@ -4,5 +4,15 @@ typedef enum { VHD_UTF_16_LE } VHDUtfType; +/* Convert string between UTF-8 and UTF-16LE + + toUTF: determines what encoding out_str will be + in_str: String to convert. String shall be null terminated UTF-16LE or UTF-8, and is expected to be the + opposite encoding from toUTF + out_str: Pointer to output string pointer. Encoding shall be determined by toUTF, and is null terminated. + It is the callers repsponsibility to free the memory allocated by this function. */ int vhd_utf_convert(VHDUtfType toUTF, void* in_str, void** out_str); +/* Count the number of "characters" in a null terminated UTF-16 string. Not a true character count, as surrogate + pairs are counted as two "characters". Appears to be the Windows definition of a character for filepath + purposes. */ size_t vhd_u16_strlen(uint16_t* u16_str); \ No newline at end of file