hxcpp icon indicating copy to clipboard operation
hxcpp copied to clipboard

String::create(wchar_t* ...) is broken on non Windows systems

Open tobil4sk opened this issue 1 year ago • 0 comments

The wchar_t overload for String::create() assumes that wchar_t has a size of two bytes, which is only the case on Windows. On other systems it creates an invalid string if a valid wchar_t* is passed in.

https://github.com/HaxeFoundation/hxcpp/blob/master/src/String.cpp#L465-L519

String::create(wchar_t* ...) should be fixed to work properly on all systems. It might also be useful to have a alloc_string16 function to accompany alloc_string and alloc_wstring.

tobil4sk avatar Dec 20 '23 11:12 tobil4sk