Skip to content

Literal should escape surrogate unicode #20693

Closed

Description

Version Used: 2.2

Steps to Reproduce:

  1. Run following code:

    var sw = new StreamWriter(new MemoryStream());
    sw.Write(SyntaxFactory.LiteralExpression(
        SyntaxKind.CharacterLiteralExpression,
        SyntaxFactory.Literal('\uDBFF')));
    sw.Flush();

Expected Behavior:
'\uDBFF'

Actual Behavior:
System.Text.EncoderFallbackException: Unable to translate Unicode character \uDBFF at index 1 to specified code page.

dotnet/docfx#1817

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

Area-CompilersBugResolution-FixedThe bug has been fixed and/or the requested behavior has been implemented

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions