Skip to content

Should multi-line raw strings preserve line encoding? #23562

Closed
@DartBot

Description

@DartBot

This issue was originally filed by [email protected]


Running:

main() {
  String s1 = 'foo\r\n';
  String s2 = r'''foo^M
''';
  print(s1.codeUnits);
  print(s2.codeUnits);
}

Will output:
[102, 111, 111, 13, 10]
[102, 111, 111, 10]

Before running, replace ^M by an actual carriage return. In Emacs insert a carriage return with C-q RET
Compiling with dart2js and running with d8 produces the expected output:
[102, 111, 111, 13, 10]
[102, 111, 111, 13, 10]

Metadata

Metadata

Assignees

Labels

area-languageDart language related items (some items might be better tracked at github.com/dart-lang/language).type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions