You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently marshaling in .NET has three modes: Ansi, Unicode (platform dependent) and "Auto" which picks a good default between those two. The meaning of Unicode is closely associated with Window's UTF16.
There is today no convenient and reliable way to do UTF8 encoding, and at best we have an ambiguous definition of what Unicode is.
There are enough bits on the metadata tables to add these two values.
People can resort to custom marshalers (slow, cumbersome, everyone has to do it), or manual marshaling, or hope that the platform does the right thing.
Anecdotally: this also happens to be oldest Mono bug that is still open.
The world has spoken, and UTF8 is the standard, we should have first-class support for it both for P/Invoke signatures as well as the various helper methods in Marshal.
mdouglass, discosultan, dlech, martin31821, skyline75489 and 19 moredivega, whoisj, aalmada and igor-kostromin