Skip to content

回复:CAboutDialog 中从 UTF-8 到 ANSI 的变通办法 ​

首次公开证据

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

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

对,我会把它改成这样,以免它再次被弄坏:

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

我并不是有意改动它的,肯定是出了某种编码问题。

这项改动的原因是什么?

#if !wxUSE_UNICODE ... if (str.Find('Â') != wxNOT_FOUND) str.Remove(str.Find('Â'), 1); 改为: if (str.Find('�') != wxNOT_FOUND) str.Remove(str.Find('�'), 1);

wxFormBuilder 会自动把 (c) 符号转换为 UTF-8。在 wxWidgets-2.8.9 ansi 上,它会显示成一个版权符号,后面还多出一个垃圾字符;这个变通办法会针对非 unicode(ansi)情形把它修正好。

英文原文 ​

展开英文原文

Right, I'll change it to this so it doesn't get broken again:

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

I didn't change it knowingly, must have been some encoding problem.

What was the reason for this change?

#if !wxUSE_UNICODE ... if (str.Find('Â') != wxNOT_FOUND) str.Remove(str.Find('Â'), 1); to: 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.

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