Skip to content

TextBlock render '\' as the Japanese currency symbol ¥ or Korean currency symbol ₩. #11092

@boxing-wang

Description

@boxing-wang

Describe the bug

When using the ApplicationLanguages::PrimaryLanguageOverride(L"jp") or ApplicationLanguages::PrimaryLanguageOverride(L"ko") to set the app's languae, the TextBlock render the '\' symbol as the Japanese currency symbol ¥ or Korean currency symbol ₩.

Why is this important?

The GridView item in a XAML file:

        <GridView.ItemTemplate>
            <DataTemplate x:DataType="local:ShapeData">
                <StackPanel
                    Orientation="Horizontal"
                    CornerRadius="4">
                    <StackPanel
                        Orientation="Vertical"
                        VerticalAlignment="Center"
                        Margin="0,0,4,4">
                       ...
                        <TextBlock
                            Text="{x:Bind CodeString, Mode=OneWay}"
                            Style="{ThemeResource CaptionTextBlockStyle}"
                            FontSize="12"
                            HorizontalAlignment="Left"
                            Margin="0,4,0,0" />
                    </StackPanel>
            </DataTemplate>
        </GridView.ItemTemplate>

using the ApplicationLanguages::PrimaryLanguageOverride(L"jp") or ApplicationLanguages::PrimaryLanguageOverride(L"ko") to set the app's languae, the TextBlock render the '\' symbol as the Japanese currency symbol ¥ or Korean currency symbol ₩.

Steps to reproduce the bug

  1. Create a WinUI project.
  2. The content of Main Window is GridView.
  3. Use the TextBlock control to render the unicode string, like "\U+0031".
  4. Use the ApplicationLanguages::PrimaryLanguageOverride(L"jp") or ApplicationLanguages::PrimaryLanguageOverride(L"ko") to set the app's languae.

Actual behavior

Image

Expected behavior

Image

Screenshots

No response

NuGet package version

WinUI 2.0.12

Windows version

Windows 11 (24H2): Build 26100

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions