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

Unicode 15 scripts and blocks are unrecognized #679

Open
benrimmington opened this issue Jun 29, 2023 · 1 comment
Open

Unicode 15 scripts and blocks are unrecognized #679

benrimmington opened this issue Jun 29, 2023 · 1 comment

Comments

@benrimmington
Copy link

The standard library was updated (by @Azoy) to use Unicode 15 data. Should the MissingUnicode.swift APIs also be updated?

/\p{Script=Arabic}/   // OK
/\p{Script=Kawi}/     // error: unrecognized script 'Kawi'
/\p{Block=Arabic}/    // error: Unicode block property is not currently supported
/\p{Block=Kawi}/      // error: unrecognized block 'Kawi'

(Old blocks are unsupported. New blocks are unrecognized.)

@benrimmington
Copy link
Author

Unrecognized names such as /\N{LOREM IPSUM}/ and /\p{Name=LOREM IPSUM}/ are allowed. However, unrecognized scripts and blocks are currently a compile-time and run-time error. This suggests that back-deployment of Regex literals might be a problem?

import Foundation

do {
  try Regex(#"\p{Script=Kawi}"#)
} catch {
  error.localizedDescription
}

The localized error description is unhelpful:

The operation couldn’t be completed. (_RegexParser.Source.LocatedError<_RegexParser.Diagnostics.(unknown context at $23808a414).(unknown context at $23808a41c).ErrorDiagnostic> error 1.)

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

No branches or pull requests

1 participant