File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -390,6 +390,16 @@ extern "C"
390390 */
391391 WINPR_API WCHAR * ConvertMszUtf8NToWCharAlloc (const char * str , size_t len , size_t * pSize );
392392
393+ /** \brief Helper function to initialize const WCHAR pointer from a Utf8 string
394+ *
395+ * \param str The Utf8 string to use for initialization
396+ * \param buffer The WCHAR buffer used to store the converted data
397+ * \param len The size of the buffer in number of WCHAR
398+ *
399+ * \return The WCHAR string (a pointer to buffer)
400+ */
401+ WINPR_API const WCHAR * InitializeConstWCharFromUtf8 (const char * str , WCHAR * buffer , size_t len );
402+
393403#if defined(WITH_WINPR_DEPRECATED )
394404 WINPR_API WINPR_DEPRECATED_VAR ("Use ConvertUtf8ToWChar functions instead" ,
395405 int ConvertToUnicode (UINT CodePage , DWORD dwFlags ,
Original file line number Diff line number Diff line change @@ -833,3 +833,11 @@ char* strndup(const char* src, size_t n)
833833 return dst ;
834834}
835835#endif
836+
837+ const WCHAR * InitializeConstWCharFromUtf8 (const char * str , WCHAR * buffer , size_t len )
838+ {
839+ WINPR_ASSERT (str );
840+ WINPR_ASSERT (buffer || (len == 0 ));
841+ ConvertUtf8ToWChar (str , buffer , len );
842+ return buffer ;
843+ }
You can’t perform that action at this time.
0 commit comments