Skip to content

CAboutDialog 中的 UTF-8 转 ANSI hack ​

首次公开证据

打开首次公开证据
查看 1 个交叉存档
来源说明

Published on GitHub in February 2024 as part of Martti Malmi's testimony in the COPA v. Wright trial

改动的原因是什么?

c
#if !wxUSE_UNICODE
...
     if (str.Find('Â') != wxNOT_FOUND)
         str.Remove(str.Find('Â'), 1);

改为:

c
     if (str.Find('�') != wxNOT_FOUND)
         str.Remove(str.Find('�'), 1);

wxFormBuilder 会自动将 (c) 符号转换成 UTF-8。在 wxWidgets-2.8.9 ansi 中,它会显示成带有额外乱码字符的版权符号;这个 hack 会在非 Unicode(ansi)情况下修正它。

英文原文 ​

展开英文原文

What was the reason for this change?

c
#if !wxUSE_UNICODE
...
     if (str.Find('Â') != wxNOT_FOUND)
         str.Remove(str.Find('Â'), 1);

to:

c
     if (str.Find('�') != wxNOT_FOUND)
         str.Remove(str.Find('�'), 1);

wxFormBuilder turns the (c) symbol into UTF-8 automatically. On wxWidgets-2.8.9 ansi, it shows as a copyright symbol with an extra trash character, which this hack fixes up for the non-unicode (ansi) case.

为历史保存,为中文读者整理。每篇档案均附来源与英文原文。