“测试:将Unicode UTF-8用于全球语言支持”的含义是什么?真的吗? [英] What does "Beta: Use Unicode UTF-8 for worldwide language support" actually do?
问题描述
在某些Windows 10版本中(从2018年4月开始,内部使用,也称为正常 1903年),有一个名为 Beta:使用Unicode UTF-8进行全球语言支持的新选项。
您可以通过依次转到设置和
所有设置->时间&语言->语言->管理语言设置
它是这样的:
选中此复选框时,我观察到一些不规则性(如下),并且我想知道此复选框的确切作用以及为什么发生以下情况。
在Visual Studio 2019中创建一个全新的Windows窗体应用程序。在主窗体上指定绘制
甚至处理程序如下:
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);
}
运行程序,这是您将看到是否未选中复选框的内容:
但是,如果您选中了此复选框,并按要求重新启动)。
您可以在Wikipedia上查找
我想找到一个
可以做到吗?
您可以在ProcMon中看到它。
似乎设置了 REG_SZ
值 ACP
, MACCP
和 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage
中的 OEMCP
b $ b到 65001
。
我不确定,但可能与 KernelBase.dll
中的变量 gAnsiCodePage
相关,其中 GetACP
读取。如果确实需要,可以通过动态反汇编 GetACP $ c来 为系统动态更改程序,而无需考虑系统设置。 $ c>查找读取
gAnsiCodePage
的指令序列并获取指向它的指针,然后直接更新该变量。
(实际上,我请参见对名为 SetCPGlobal $的未记录函数的引用c $ c>
可以完成工作,但是我无法在系统上找到该功能。不确定该功能是否仍然存在。)
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 "\U0001F5D5\U0001F5D9"
. 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_MACHINE\SYSTEM\CurrentControlSet\Control\Nls\CodePage
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.)
这篇关于“测试:将Unicode UTF-8用于全球语言支持”的含义是什么?真的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!