Issue 24841 - UTF-16 surrogates when used as an escape of a string should hint on error
Summary: UTF-16 surrogates when used as an escape of a string should hint on error
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 enhancement
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2024-11-02 06:42 UTC by Richard (Rikki) Andrew Cattermole
Modified: 2024-11-16 23:27 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Richard (Rikki) Andrew Cattermole 2024-11-02 06:42:50 UTC
UTF-16 has some special ranges assigned to it known as surrogates.

If they appear as a dchar it is rightly an error.

The lexer should when it sees this range, should error but hint that what you tried to escape was the wchar's as if they were dchar's.
Comment 1 Dlang Bot 2024-11-02 06:56:31 UTC
@rikkimax created dlang/dmd pull request #17047 "Fix bugzilla issue 24841 - UTF-16 surrogates when used as an escape of a string should hint on error" fixing this issue:

- Fix bugzilla issue 24841 - UTF-16 surrogates when used as an escape of a string should hint on error

https://github.com/dlang/dmd/pull/17047
Comment 2 Dlang Bot 2024-11-03 11:30:59 UTC
dlang/dmd pull request #17047 "Fix bugzilla issue 24841 - UTF-16 surrogates when used as an escape of a string should hint on error" was merged into stable:

- 6fb4da37daaf1767b78b1bc0791591dcf8c2dfb8 by Richard (Rikki) Andrew Cattermole:
  Fix bugzilla issue 24841 - UTF-16 surrogates when used as an escape of a string should hint on error

https://github.com/dlang/dmd/pull/17047
Comment 3 Dlang Bot 2024-11-16 23:27:17 UTC
dlang/dmd pull request #17069 "Merge stable" was merged into master:

- b11b3f3bfa8d8fd1dd9413bb97d044855aef7613 by Richard (Rikki) Andrew Cattermole:
  Fix bugzilla issue 24841 - UTF-16 surrogates when used as an escape of a string should hint on error

https://github.com/dlang/dmd/pull/17069