Skip to content

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

@DaZombieKiller

Description

@DaZombieKiller

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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions