English 中文(简体)
银光消息框。 Show () 没有显示中文字符
原标题:Silverlight MessageBox.Show() not displaying Chinese characters

我正在对应用程序进行本地化, 并通过它, 有信箱提醒用户某些事物。 当我在 VS 2010 调试时, 我将中国字符包含在文本区域中时, 它们看起来就像一堆方形, 但是当 UI 显示时, 当它通过属性对象的链接显示时, 它会转换成正确的字符 。 但是当代码直接调用信息框时, 显示( “ 捷克字符 ” ) 只会显示一堆空方形 。 为什么这样呢?

问题回答

在 Silverlight 中不存在“ 双字节” 。 所有字符串都编码在 utf-16 中。 双字节是从 8 位代码页面的日数算作的黑客, 以找到编码 CJK 文本的方法。 您需要将这种编码文本转换为 utf-16 编码类 。

将文字显示为正方形可以是因为字符是控制代码, 原因是编码错误。 或者对安装在机器上的字体中的字符缺少支持 。 这也是一个迅速消失的问题, 您通常只在 XP 上安装它而不安装东亚字体支持 。





相关问题
Manually implementing high performance algorithms in .NET

As a learning experience I recently tried implementing Quicksort with 3 way partitioning in C#. Apart from needing to add an extra range check on the left/right variables before the recursive call, ...

Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How do I compare two decimals to 10 decimal places?

I m using decimal type (.net), and I want to see if two numbers are equal. But I only want to be accurate to 10 decimal places. For example take these three numbers. I want them all to be equal. 0....

Exception practices when creating a SynchronizationContext?

I m creating an STA version of the SynchronizationContext for use in Windows Workflow 4.0. I m wondering what to do about exceptions when Post-ing callbacks. The SynchronizationContext can be used ...

Show running instance in single instance application

I am building an application with C#. I managed to turn this into a single instance application by checking if the same process is already running. Process[] pname = Process.GetProcessesByName("...

How to combine DataTrigger and EventTrigger?

NOTE I have asked the related question (with an accepted answer): How to combine DataTrigger and Trigger? I think I need to combine an EventTrigger and a DataTrigger to achieve what I m after: when ...

热门标签