corert icon indicating copy to clipboard operation
corert copied to clipboard

Support correct ANSI marshaling semantics

Open yizhang82 opened this issue 9 years ago • 2 comments

https://github.com/dotnet/corert/blob/master/src/System.Private.CoreLib/src/Internal/Runtime/CompilerHelpers/InteropHelpers.cs

 internal static unsafe byte[] StringToAnsi(String str)
        {
            if (str == null)
                return null;

            // CORERT-TODO: Use same encoding as the rest of the interop
            var encoding = Encoding.UTF8;

It needs to account for ANSI in Windows.

yizhang82 avatar Jan 10 '17 07:01 yizhang82

Also, it would be nice for it to allocate on stack for small strings... .

jkotas avatar Jan 10 '17 11:01 jkotas

Fixed in https://github.com/dotnet/corert/pull/3315

shrah avatar Apr 26 '17 07:04 shrah