swiftlang/swift-experimental-string-processing

Unicode 15 scripts and blocks are unrecognized

Opened this issue · 1 comments

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.)

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.)