microsoft / krabsetw

KrabsETW provides a modern C++ wrapper and a .NET wrapper around the low-level ETW trace consumption functions.
Other
588 stars 147 forks source link

ImageFileName cannot be parsed with wstring? #188

Open bu-shuo opened 2 years ago

bu-shuo commented 2 years ago

https://github.com/microsoft/krabsetw/blob/d4688217e01440bbea9db6d560b3d649a7acdb93/examples/NativeExamples/kernel_trace_003_rundown.cpp?_pjax=%23js-repo-pjax-container%2C%20div%5Bitemtype%3D%22http%3A%2F%2Fschema.org%2FSoftwareSourceCode%22%5D%20main%2C%20%5Bdata-pjax-container%5D#L74

When I use the std::string class to parse Chinese characters, there will be garbled code in the ImageFileName, but it cannot be parsed using the wstring class. How can I solve this problem?

Jondoe398 commented 2 years ago

You just set up the Locale like “std::wcout.imbue(std::locale(""));”