Re: Is there any bettter solution to Windows wide string

2021-05-09 Thread Vinod K Chandran via Digitalmars-d-learn
On Sunday, 9 May 2021 at 09:34:00 UTC, FreeSlave wrote: You may try using tempCStringW from std.internal.cstring. It uses small string optimization. However the api is internal, so I'm not sure how valid it is to use this function. The returned struct is a temporary buffer so you must

Re: Is there any bettter solution to Windows wide string

2021-05-09 Thread FreeSlave via Digitalmars-d-learn
On Saturday, 8 May 2021 at 20:50:10 UTC, Vinod K Chandran wrote: Hi all, I am planning some win32 hobby projects. Now I have this function to tackle the LPCWSTR data type in win32. ```d private import std.utf; auto toWString(S)(S s) { return toUTFz!(const(wchar)*)(s); } ``` Is there any better

Re: Is there any bettter solution to Windows wide string

2021-05-08 Thread Vinod K Chandran via Digitalmars-d-learn
On Saturday, 8 May 2021 at 21:26:06 UTC, Imperatorn wrote: iirc that's toUTF16z Thanks. Let me check. :)

Re: Is there any bettter solution to Windows wide string

2021-05-08 Thread Imperatorn via Digitalmars-d-learn
On Saturday, 8 May 2021 at 20:50:10 UTC, Vinod K Chandran wrote: Hi all, I am planning some win32 hobby projects. Now I have this function to tackle the LPCWSTR data type in win32. ```d private import std.utf; auto toWString(S)(S s) { return toUTFz!(const(wchar)*)(s); } ``` Is there any better

Is there any bettter solution to Windows wide string

2021-05-08 Thread Vinod K Chandran via Digitalmars-d-learn
Hi all, I am planning some win32 hobby projects. Now I have this function to tackle the LPCWSTR data type in win32. ```d private import std.utf; auto toWString(S)(S s) { return toUTFz!(const(wchar)*)(s); } ``` Is there any better way to do this ?