Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

[WIP]Add DllImport Charset UTF8 #18186

Closed
wants to merge 1 commit into from
Closed

[WIP]Add DllImport Charset UTF8 #18186

wants to merge 1 commit into from

Conversation

luqunl
Copy link

@luqunl luqunl commented May 29, 2018

The purpose is to enable Charset.UTF8 support for DllImport, which will help customer to write cross-platform PInvoke.

Partial Fix https://github.com/dotnet/coreclr/issues/1012

Remaining problems:

  1. UTF8 Array isn't support yet.
  2. Update roslyn to support Charset UTF8
  3. There are couple shift/reduce, reduce/reduce conflict for ilasm yy file
  4. More testing

Open problems:

  1. What's the native type for default char marshalling with [DllImport(CharSet = CharSet.UTF8)]
    Currently use U2 instead.
  2. Whether UnmanagedType.LPTSTR should support UTF8?
    Currently LPTSTR only supports ANSI/Unicode
  3. Whether UnmanagedType.AsAny should support UTF8?
    Currently AsAny doesn't support UTF8.
  4. Ongoing support for UTF16(LE/BE), UTF32?

@@ -1956,7 +1956,7 @@ typedef enum
nltAnsi = 2, // ansi keyword specified
nltUnicode = 3, // unicode keyword specified
nltAuto = 4, // auto keyword specified
nltOle = 5, // ole keyword specified
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nltOle isn't used..

@jkotas
Copy link
Member

jkotas commented Dec 1, 2018

Closing stale PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants