Skip to content

Instantly share code, notes, and snippets.

@sstadelman
Created May 14, 2019 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sstadelman/1b6c66cf72088b765b2a6eb24f175561 to your computer and use it in GitHub Desktop.
Save sstadelman/1b6c66cf72088b765b2a6eb24f175561 to your computer and use it in GitHub Desktop.
var arabic = CharacterSet(charactersIn: Unicode.Scalar(UInt16(0x0600))!...Unicode.Scalar(UInt16(0x06ff))!)
let arabicSupplement = CharacterSet(charactersIn: Unicode.Scalar(UInt16(0x750))!...Unicode.Scalar(UInt16(0x077f))!)
let arabicExtendedA = CharacterSet(charactersIn: Unicode.Scalar(UInt16(0x08a0))!...Unicode.Scalar(UInt16(0x08ff))!)
let arabicPresentationFormsA = CharacterSet(charactersIn: Unicode.Scalar(UInt16(0xfb50))!...Unicode.Scalar(UInt16(0xfdff))!)
let arabicPresentationFormsB = CharacterSet(charactersIn: Unicode.Scalar(UInt16(0xfe70))!...Unicode.Scalar(UInt16(0xfeff))!)
let rumiNumeralSymbols = CharacterSet(charactersIn: Unicode.Scalar(UInt32(0x10e60))!...Unicode.Scalar(UInt32(0x10e7f))!)
let indicSiyaqNumbers = CharacterSet(charactersIn: Unicode.Scalar(UInt32(0x1ec70))!...Unicode.Scalar(UInt32(0x1ecbf))!)
let ottomanSiyaqNumbers = CharacterSet(charactersIn: Unicode.Scalar(UInt32(0x1ed00))!...Unicode.Scalar(UInt32(0x1ed4f))!)
let arabicMathematicalAlphabeticSymbols = CharacterSet(charactersIn: Unicode.Scalar(UInt32(0x1ee00))!...Unicode.Scalar(UInt32(0x1eeff))!)
arabic.formUnion(arabicSupplement)
arabic.formUnion(arabicExtendedA)
arabic.formUnion(arabicPresentationFormsA)
arabic.formUnion(arabicPresentationFormsB)
arabic.formUnion(rumiNumeralSymbols)
arabic.formUnion(indicSiyaqNumbers)
arabic.formUnion(ottomanSiyaqNumbers)
arabic.formUnion(arabicMathematicalAlphabeticSymbols)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment