Wpf Arabic text not displaying correctly

I want to display Arabic text from right to left. Therefore, I set the flow direction as RightToLeft. Below is my program:

<Grid x:Name="LayoutRoot" HorizontalAlignment="Left" VerticalAlignment="Top" >
    <TextBlock Margin="104,96,0,0" VerticalAlignment="Top" Height="Auto" Text="(وقت القاعدة الرئيسية 1 (بتوقيت 12 ساعة"  HorizontalAlignment="Left" FontSize="20" />
</Grid>

The result does not seem correct. The closing bracket appears in a different position. output signal is 1 (بتوقيت 12 ساعة)

Please provide suggestions / solutions.

+3
source share
1 answer

, , "" XAML, "(", , . , , , ")" ( ).

, XAML WPF, , Unicode & ux200F; XAML , ")" - .

Wikipedia

"run". , . , , ( LTR, LTR, RTL-, RTL). "" "" , " . . " " . . ( U + 200E (HTML: & LRM; LRM) U + 200F (HTML: & RLM; RLM)) , .

Try

<Grid x:Name="LayoutRoot" HorizontalAlignment="Left" VerticalAlignment="Top" >
    <TextBlock Margin="104,96,0,0" VerticalAlignment="Top" Height="Auto" Text="وقت القاعدة الرئيسية 1 (بتوقيت 12 ساعة)‏"  HorizontalAlignment="Left" FontSize="20" />
</Grid>

, , , .

+5

Source: https://habr.com/ru/post/1778890/


All Articles