Page 4 of 4
Re: Error: reference to invalid character number at line 6
Posted: Fri Sep 29, 2017 12:18 pm
by steve
steve wrote:It would appear that an alternative solution would be to build WxWidgets on Windows with wxUSE_UNICODE_UTF8=1 so that UTF-8 encoding is used on all platforms.
but on the other hand, perhaps not.
Although that document seems to suggest that we can use wxUSE_UNICODE_UTF8=1 on Windows, further reading suggests that a lot can go wrong if attempting to do so.
As an experiment, I built wxWidgets with wxUSE_UNICODE_UTF8=1, and then attempted to build Audacity, but got stuck with linker errors.
I'm coming round to your approach
UTF-8 would be such a great idea, if only MS ....
Re: Error: reference to invalid character number at line 6
Posted: Fri Sep 29, 2017 5:56 pm
by Yarn366
steve wrote:
Although that document seems to suggest that we can use wxUSE_UNICODE_UTF8=1 on Windows, further reading suggests that a lot can go wrong if attempting to do so.
As an experiment, I built wxWidgets with wxUSE_UNICODE_UTF8=1, and then attempted to build Audacity, but got stuck with linker errors.
Even if you didn't get linker errors, there would still be a problem with Audacity using UTF-8 on Windows: wxString's character-access functions use wxUniChar, which is 4 bytes on all platforms, but Audacity never uses that and instead uses wxChar and wxUChar, which are just wchar_t when wxUSE_UNICODE==1. And as you may or may not know, wchar_t is only 2 bytes on Windows (whereas it's 4 bytes on Linux and macOS). Since wxString actually decodes UTF-8, this would result in supplementary characters being truncated and therefore corrupted due to casting wxUniChar (4 bytes) to wxChar or wxUChar (2 bytes on Windows).
Re: Error: reference to invalid character number at line 6
Posted: Fri Sep 29, 2017 8:13 pm
by steve
I've sent you a PM Yam366.
Re: Error: reference to invalid character number at line 6
Posted: Mon Nov 13, 2017 5:32 pm
by steve
I've committed the fix for this, so barring unforeseen problems it should be fixed in Audacity 2.2.1 in December.
Many thanks to Yam366 for providing the fix and helping me to understand the problem.
Re: Error: reference to invalid character number at line 6
Posted: Mon Nov 13, 2017 5:55 pm
by waxcylinder
steve wrote:Many thanks to Yam366 for providing the fix and helping me to understand the problem.
I second that vote of thanks for Yam366
WC