LLVM 7.0.1安装程序中的文本损坏 [英] Text corruption in LLVM 7.0.1 installer

查看:117
本文介绍了LLVM 7.0.1安装程序中的文本损坏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在Windows 10上安装llvm 7.0.1.
但是安装程序的文本损坏如下所示. 它使安装变得更加困难.
我如何解决它?

I have tried install llvm 7.0.1 on Windows 10.
But the installer has text corruption like below. It make so harder to install.
How do I fix it?

我使用Windows 10 1809,chcp是65001.
我用日语.

I using Windows 10 1809, chcp is 65001.
I using Japanese.

我已在区域设置"中启用了使用Unicode UTF-8进行全球语言支持".

I have enabled "Use Unicode UTF-8 for worldwide language support" in Region settings".

这是错误的原因吗? 但是,其他应用程序的安装程序不会导致文本损坏.

Is this change cause of the error? But A installer of other application does not be text curruption.

具有兼容模式的安装程序的图片(Windows XP SP3)

The Picture of installer with compatibility mode (Windows XP SP3)

推荐答案

该LLVM安装程序不是Unicode NSIS安装程序. LLVM团队可以通过在其NSIS脚本中添加Unicode True来对其进行修复.

That LLVM installer is not a Unicode NSIS installer. The LLVM team can fix it by adding Unicode True to their NSIS script.

LLVM安装程序看起来好像支持多种语言(我找不到它的源,它可能使用的是CMake/Ninja),NSIS确实尝试猜测正确的语言,但这基于GetUserDefaultUILanguage()的返回值,并且不是有效的代码页.

That LLVM installer looks like it supports multiple languages (I could not find it's source, it might be using CMake/Ninja) and NSIS does try to guess the correct language but this is based on the return value of GetUserDefaultUILanguage() and not the active codepage.

我无法在版本18290上复制您的问题(更改为UTF-8并重新启动后,我确认GetACP()返回65001),但这可能是因为NSIS将我的系统检测为英语.

I could not replicate your issue on build 18290 (after changing to UTF-8 and rebooting I verified that GetACP() returns 65001) but this is probably because my system is detected as English by NSIS.

基于屏幕快照中下一步"按钮中的(N),我猜您的UI语言被检测为中文还是日语?

Based on the (N) in your Next button in your screenshot I'm going to guess that your UI language is detected as Chinese or Japanese?

如果没有有关您的系统的更多信息,很难猜测这是NSIS还是Windows中的错误. NSIS是一个相对普通的应用程序,不会在其接口字符串(IIRC)上调用MultiByteToWideChar.

Without more information about your system it is hard to guess if this is a bug in NSIS or Windows. NSIS is a relatively normal application and does not call MultiByteToWideChar on its interface strings (IIRC).

通过强迫安装人员选择日语,我可以复制您的问题.如果您希望使用日语作为显示语言来安装此应用程序,则此问题的解决方案是将非Unicode程序的语言"切换回日语.您可以尝试的另一种解决方案是为单个应用程序设置区域设置. AppLocale 是Microsoft的解决方案,但Windows 10上不支持,但还有其他替代方法.

By forcing a installer to pick Japanese I can replicate your issue. The solution for this issue is to switch your "language for non-Unicode programs" back to Japanese if you wish to install this application using Japanese as the display language. Another solution you can try is to set the locale for a single application. AppLocale was Microsoft's solution to this but it is not supported on Windows 10 but there are other alternatives out there.

在构建不支持Unicode的NSIS安装程序时,程序会在内部将文本存储为使用特定语言代码页编码的原始字节.在运行时,它使用SetWindowTextA之类的功能来设置UI元素的文本.自Windows出现以来,这就是非Unicode应用程序的工作方式.除非显示的所有非Unicode程序都是为支持UTF-8作为活动代码页而专门编写的,否则所有显示ASCII范围以外的文本的非Unicode程序都将遇到相同的问题(这不太可能,因为这是一个新功能).此功能仅对假定窄字符串是UTF-8编码的控制台应用程序和移植的POSIX应用程序有用.

When building a NSIS installer without Unicode support the program stores the text internally as raw bytes encoded with the codepage of the specific language. At run time it uses functions like SetWindowTextA to set the text of UI elements. This is how non-Unicode applications have worked since the dawn of time on Windows. All non-Unicode programs that display text outside the ASCII range will have the same issue unless they have been specifically written to support UTF-8 as the active codepage (which is unlikely since it is a new feature). This feature is only useful for console applications and ported POSIX applications that assume that the narrow string is UTF-8 encoded.

这篇关于LLVM 7.0.1安装程序中的文本损坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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