“Beta:使用 Unicode UTF-8 获得全球语言支持"是什么意思?实际上呢? [英] What does "Beta: Use Unicode UTF-8 for worldwide language support" actually do?

查看:250
本文介绍了“Beta:使用 Unicode UTF-8 获得全球语言支持"是什么意思?实际上呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在某些 Windows 10 版本中(从 2018 年 4 月开始的内部人员以及正常"1903 年),有一个名为测试版:使用 Unicode UTF-8 获得全球语言支持"的新选项.

您可以通过转到设置来查看此选项,然后:所有设置 -> 时间 &语言 -> 语言 -> 管理语言设置"

这就是它的样子:

选中此复选框时,我观察到一些异常情况(如下),我想知道此复选框的具体作用以及为什么会发生以下情况.

在您的 Visual Studio 2019 中创建一个全新的 Windows 窗体应用程序.在主窗体上指定 Paint 偶数处理程序,如下所示:

private void Form1_Paint(object sender, PaintEventArgs e){字体 buttonFont = new Font("Webdings", 9.25f);TextRenderer.DrawText(e.Graphics, "0r", buttonFont, new Point(), Color.Black);}

运行程序,如果未选中复选框,您将看到以下内容:

但是,如果您选中复选框(并按要求重新启动),则会更改为:

您可以在 Wikipedia 上查找

我想找到一个始终有效的解决方案,无论复选框是否选中.

这个可以吗?

解决方案

你可以在 ProcMon 中看到.似乎在 HKEY_LOCAL_MACHINESYSTEMCurrentControlSet 中设置了 REG_SZACPMACCPOEMCPControlNlsCodePage65001.

我不完全确定,但它可能KernelBase.dll 中的变量 gAnsiCodePage 相关,GetACP 读取.如果您真的想要,可能可以通过动态反汇编 GetACP 来为您的程序动态更改它,而不管系统设置如何.读取gAnsiCodePage并获取指向它的指针,然后直接更新变量的指令序列.

(实际上,我看到对名为 SetCPGlobal 的未记录函数的引用/a> 可以完成这项工作,但我在我的系统上找不到该功能.不确定它是否仍然存在.)

In some Windows 10 builds (insiders starting April 2018 and also "normal" 1903) there is a new option called "Beta: Use Unicode UTF-8 for worldwide language support".

You can see this option by going to Settings and then: All Settings -> Time & Language -> Language -> "Administrative Language Settings"

This is what it looks like:

When this checkbox is checked I observe some irregularities (below) and I would like to know what exactly this checkbox does and why the below happens.

Create a brand new Windows Forms application in your Visual Studio 2019. On the main form specify the Paint even handler as follows:

private void Form1_Paint(object sender, PaintEventArgs e)
{
    Font buttonFont = new Font("Webdings", 9.25f);
    TextRenderer.DrawText(e.Graphics, "0r", buttonFont, new Point(), Color.Black);
}

Run the program, here is what you will see if the checkbox is NOT checked:

However, if you check the checkbox (and reboot as asked) this changes to:

You can look up Webdings font on Wikipedia. According to character table given, the codes for these two characters are "U0001F5D5U0001F5D9". If I use them instead of "0r" it works with the checkbox checked but without the checkbox checked it now looks like this:

I would like to find a solution that always works that is regardless whether the box checked or unchecked.

Can this be done?

解决方案

You can see it in ProcMon. It seems to set the REG_SZ values ACP, MACCP, and OEMCP in HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlNlsCodePage to 65001.

I'm not entirely sure but it might be related to the variable gAnsiCodePage in KernelBase.dll, which GetACP reads. If you really want to, you might be able to change it dynamically for your program regardless of the system setting by dynamically disassembling GetACP to find the instruction sequence that reads gAnsiCodePage and obtaining a pointer to it, then updating the variable directly.

(Actually, I see references to an undocumented function named SetCPGlobal that would've done the job, but I can't find that function on my system. Not sure if it still exists.)

这篇关于“Beta:使用 Unicode UTF-8 获得全球语言支持"是什么意思?实际上呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆