diff options
author | Jeremy Koritzinsky <jkoritzinsky@gmail.com> | 2019-04-03 14:08:06 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-03 14:08:06 -0700 |
commit | 0164d68225520d2292de144e69d8187ef9768be5 (patch) | |
tree | 9d295d48265b9a3dbfc69d28538575446cc3d1e7 /src/vm/methodtablebuilder.cpp | |
parent | 4758dd12887a97daa4cf6acd34a11fc27c4c26fc (diff) | |
download | coreclr-0164d68225520d2292de144e69d8187ef9768be5.tar.gz coreclr-0164d68225520d2292de144e69d8187ef9768be5.tar.bz2 coreclr-0164d68225520d2292de144e69d8187ef9768be5.zip |
Change Auto charset to mean UTF-8 off-Windows (#23664)
Match Mono's behavior by changing the Auto character set to mean UTF-8 on non-Windows platforms (new behavior) and UCS-2/UTF-16 on Windows (current behavior).
Fixes #23464
Fixes dotnet/corefx#32442
Impact of breaking change: It is highly unlikely that anyone is actively using current behavior since it is inconsistent with Mono and doesn't match any native system APIs on non-Windows platforms (they're all UTF-8 based).
We will need to update our documentation to reflect this updated behavior.
Diffstat (limited to 'src/vm/methodtablebuilder.cpp')
-rw-r--r-- | src/vm/methodtablebuilder.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/vm/methodtablebuilder.cpp b/src/vm/methodtablebuilder.cpp index d4ce5b0df0..b9460264c3 100644 --- a/src/vm/methodtablebuilder.cpp +++ b/src/vm/methodtablebuilder.cpp @@ -11913,10 +11913,18 @@ BOOL HasLayoutMetadata(Assembly* pAssembly, IMDInternalImport* pInternalImport, { *pNLTType = nltAnsi; } - else if (IsTdUnicodeClass(clFlags) || IsTdAutoClass(clFlags)) + else if (IsTdUnicodeClass(clFlags)) { *pNLTType = nltUnicode; } + else if (IsTdAutoClass(clFlags)) + { +#ifdef PLATFORM_WINDOWS + *pNLTType = nltUnicode; +#else + *pNLTType = nltAnsi; // We don't have a utf8 charset in metadata yet, but ANSI == UTF-8 off-Windows +#endif + } else { pAssembly->ThrowTypeLoadException(pInternalImport, cl, IDS_CLASSLOAD_BADFORMAT); |