Martti Malmi 通信

CAboutDialog 中从 UTF-8 转为 ANSI 的变通处理

中本聪 · 2010 年 2 月 4 日

SN-10142 附来源、原文与上下文。

阅读语言

为什么作这个改动?

What was the reason for this change?

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

改为:

to:

     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)情况下的问题。

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.

来源

阅读字号

选择适合你的字号,之后阅读会继续使用。