← Back to team overview

kicad-developers team mailing list archive

Re: UTF-8 change please test on Windows/Mac

 

Hey John,

Does this patch need to be merged?  It looks a though it should be as it
would be useful for testing the UTF8 object.

Cheers,

Wayne

On 10/18/2018 6:22 AM, John Beard wrote:
> Hi Seth,
> 
> I noticed in that commit some test data to tools/utf8_test.cpp. However,
> the "Utf8AndWx" test case in qa_common doesn't work with Unicode in the
> input string.
> 
> Doing a quick check back, this never worked, but wasn't covered in the
> tests, which only used ASCII literals for the conversion/equality tests.
> 
> Here's a demo patch for the failing tests (adds a test for conversion of
> ASCII-only and UTF8 strings, the second one fails). Maybe I'm holding it
> wrong, but it seems to me this should work:
> 
>     #define UTF8_LITERAL "This is a test of UTF-8: ü‱☺😕😱" // Why so
> serious?
> 
>     UTF8 utf8_inited { UTF8_LITERAL };
>     wxString wx_inited { UTF8_LITERAL };
> 
>     wxString wx_copied_from_utf8 = utf8_inited;
>     BOOST_CHECK_EQUAL( wx_inited, wx_copied_from_utf8 );
> 
> Cheers,
> 
> John
> 
> On Wed, Oct 17, 2018 at 8:42 PM <seth@xxxxxxxxxxxxx
> <mailto:seth@xxxxxxxxxxxxx>> wrote:
> 
>     On 2018-10-17 12:19, jp charras wrote:
>     >>
>     >>
>     >> OK, I'll need to look at this more deeply.  Does W7 work with the
>     >> example unicode 😕?  This is the one given in the bug report that
>     >> crashes Linux.
>     >>
>     >> -Seth
>     >>
>     >
>     > It is incorrectly displayed in dialogs, but it does not create issues
>     > in
>     > eeschema and pcbnew.
>     > I tested 2 other unicode chars (‱ and ☺) shown in dialogs and ‱ is
>     > shown
>     > with our graphic font.
>     > I am thinking these two unicode chars have a code > 16 bits.
> 
>     Both the bp and smile are in the basic plane (0x2031 and 0x263A).  They
>     both worked correctly under Linux without the change.
> 
>     Here are a few codeblocks that did crash Linux (any symbol in them):
>     https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols
>     https://en.wikipedia.org/wiki/Emoticons_(Unicode_block)
>     https://en.wikipedia.org/wiki/CJK_Compatibility_Ideographs_Supplement
> 
>     I've pushed an update that hopefully fixes the MSW crash.  Let me know
>     if it doesn't work for you.
> 
>     -Seth
> 
>     _______________________________________________
>     Mailing list: https://launchpad.net/~kicad-developers
>     Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
>     <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
>     Unsubscribe : https://launchpad.net/~kicad-developers
>     More help   : https://help.launchpad.net/ListHelp
> 
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
> 


Follow ups

References