How to replace the alf bel tanween with a normal alf
I don't know C#, but that's more a UNICODE question. I would do it by means of UNICODE normalization, using this function.
First, normalize to decomposed form. Next, filter out all characters from the "Mark, Nonspacing" category [Mn]. Finally, normalize back to composed form.
If I see correctly, your glyph is represented in UNICODE by ARABIC LETTER ALEF WITH HAMZA ABOVE
(U+0623, [Lo]) followed by ARABIC FATHATAN
(U+064B, [Mn]). The first character decomposes to ARABIC LETTER ALEF
(U+0627, [Lo]) + ARABIC HAMZA ABOVE
(U+0654, [Mn]).
Here's the chain of transformations (the first arrow indicates a decomposition, the second – filtering out nonspacing marks, the third – a composition):
U+0623 + U+064B → U+0627 + U+0654 + U+064B → U+0627 → U+0627
After you decompose, remove all the characters from the [Mn] category, and compose back, you're left with ARABIC LETTER ALEF
only.
Take a look at this project which provides examples of how to replace unicode characters in strings: http://www.codeproject.com/KB/string/FontGlyphSet.aspx
See also:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With