Skip to content

In an Arabic (ar) environment, TextBlock Run behaves abnormally when displaying pure numbers. #11196

@daigs

Description

@daigs

Description

In an Arabic (ar) environment, TextBlock Run behaves abnormally when displaying pure numbers.

Image Image

Reproduction Steps

Create a new .NET 9 WPF application and add the following code:

    public MainWindow()
    {
        CultureInfo.CurrentUICulture = new CultureInfo("ar");
        this.Language = XmlLanguage.GetLanguage(CultureInfo.CurrentUICulture.Name);
        this.FlowDirection = CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft ? FlowDirection.RightToLeft : FlowDirection.LeftToRight;

        InitializeComponent();
    }

<Window
    x:Class="WpfApp1.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    Title="MainWindow"
    Width="800"
    Height="450"
    mc:Ignorable="d">
    <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
        <TextBlock FontSize="18" FontWeight="Bold">
            <Run d:Text="25.4.10.10" Text="99.99.99.99" />
            <LineBreak />
            <Run d:Text="801" Text="801" />
            <LineBreak />
            <Run d:Text="802" Text="802" />
            <LineBreak />
            <Run d:Text="803" Text="803" />
            <LineBreak />
        </TextBlock>
    </Grid>
</Window>

Expected behavior

Display numbers normally

Actual behavior

The displayed numbers are abnormal, like garbled text.

Image

Regression?

No response

Known Workarounds

No response

Impact

No response

Configuration

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions