Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20221215190143.2107896-5-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg25733.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit 4b6854881c36e16054878e0467ef87d925e20cae)
| ... | ... |
@@ -143,6 +143,19 @@ my_strupr(char *str) |
| 143 | 143 |
} |
| 144 | 144 |
} |
| 145 | 145 |
|
| 146 |
+/** |
|
| 147 |
+ * This function expects a null-terminated string in src and will |
|
| 148 |
+ * copy it (including the terminating NUL byte), |
|
| 149 |
+ * alternating it with 0 to dst. |
|
| 150 |
+ * |
|
| 151 |
+ * This basically will transform a ASCII string into valid UTF-16. |
|
| 152 |
+ * Characters that are 8bit in src, will get the same treatment, resulting in |
|
| 153 |
+ * invalid or wrong unicode code points. |
|
| 154 |
+ * |
|
| 155 |
+ * @note the function will blindly assume that dst has double |
|
| 156 |
+ * the space of src. |
|
| 157 |
+ * @return the length of the number of bytes written to dst |
|
| 158 |
+ */ |
|
| 146 | 159 |
static int |
| 147 | 160 |
unicodize(char *dst, const char *src) |
| 148 | 161 |
{
|