Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClangSharpPInvokeGenerator incorrectly handles string escape sequences in preview codegen mode #478

Closed
DaZombieKiller opened this issue Oct 3, 2023 · 0 comments · Fixed by #485

Comments

@DaZombieKiller
Copy link
Contributor

Given the following C/C++ definition:

static const char StringContainingNulls[] = "Hello\0World";

ClangSharpPInvokeGenerator will produce the following C# code with --config preview-codegen:

public static ReadOnlySpan<byte> StringContainingNulls => "Hello\\0World"u8;

Instead of the expected:

public static ReadOnlySpan<byte> StringContainingNulls => "Hello\0World"u8;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant