wjwwood / serial

Cross-platform, Serial Port library written in C++
http://wjwwood.github.com/serial/
MIT License
2.11k stars 1.02k forks source link

Fixing compiler warning in win.cc #295

Open cwhelms opened 8 months ago

cwhelms commented 8 months ago

The converstion from a wstring to std::string gave a warning: C4244: 'argument': conversion from 'const wchar_t' to 'const _Elem', possible loss of data.

Conversion used to be recommended with codecvt, but that has been deprecated, so a transform here is simplest I think.

For reference on the options: https://stackoverflow.com/questions/4804298/how-to-convert-wstring-into-string/12097772#12097772