Why WinUI3 textblock cannot display Unicode characters?

aluzi liu 486 Reputation points
2023-04-19T07:22:33.7266667+00:00

I create a new WinUI3 project, put a TextBlock in window:

<TextBlock>物語の進行に合わせて、入手したアイテムで敵と戦いながら</TextBlock>

then build project and run, it shows me: wpf-01

What's wrong with the textblock control?

Windows App SDK
Windows App SDK
A set of Microsoft open-source libraries, frameworks, components, and tools to be used in apps to access Windows platform functionality on many versions of Windows. Previously known as Project Reunion.
731 questions
XAML
XAML
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
772 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jeanine Zhang-MSFT 9,266 Reputation points Microsoft Vendor
    2023-04-20T01:36:48.6466667+00:00

    Hello, Welcome to Microsoft Q&A! I suggest you could try to set the encoding to Unicode.

    File -> Save ….xaml As… -> Save with Encoding -> Codepage 65001

    User's image

    User's image

    User's image

    Result:

    User's image

    Thank you.

    Jeanine


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful