some strings you might have to create a monogram for with no clear solution:
"Mhi'ya Iman Le'Paige"
"John Appleseed"
"Dr. Jonathan Maple Appleseed Esq."
"Père Jean-Philippe de Zélicourt"
"Dr. med. Max Mustermann junior, M.A."
"木田 泰夫"
"أحمد الراجحي"
The naïve approach that I've seen quite a few times is just taking the first two characters and lobbing off the rest.
But now you have a bunch of monograms that look like “DR” or “JO” or “PÈ” which makes no sense as a monogram.
In Swift, `PersonNameComponentsFormatter` could be useful here. But when I was doing this for a web project, no idea what you’re supposed to do with nothing but some regular expressions and faith that you’ll have something serviceable.