When you use DllImport to import a function, you can tell CharSet to use. I noticed that in C #, C ++, and Visual Basic .Net runtime uses Ansi by default instead of Unicode for this. Therefore, for any system call with versions A and W, the version A..Net will be called by default, it uses unicode inside, and if I'm not mistaken, new versions of windows will also translate everything to Unicode, so this means a lot of additional assembly overhead.
I got the habit of always specifying unicode here, is this the right way to do something or will it cause problems?
source share