microsoft / wil

Windows Implementation Library
MIT License
2.57k stars 234 forks source link

Standard facility to convert between ANSI and UNICODE. Similar to ATL::CA2W and ATL::CW2A #426

Open malkindan opened 7 months ago

malkindan commented 7 months ago

Is there any standard way to convert strings in WIL? I could not find any examples.

dunhor commented 7 months ago

You mean like a wrapper around WideCharToMultiByte & vice-versa? Nothing currently seems to exist from what I can see, but such a thing might be generally useful. E.g. something like wil::WideCharToMultiByte<StringT>(...)/wil::WideCharToMultiByteNoThrow(..., StringT&)

malkindan commented 7 months ago

Yes . Wrappers over WideCharToMultiByte and MultiByteToWideChar