dotnet / dotnet/wpf

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

Open
#11,196 7 comments 1 reaction 0 assignees View on GitHub
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

### 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();
}












```

### 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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.