Complete

WERETECH-10739

Fixed

Bug in compilator , with String.equals and utf8 symbol

Function Always show false, but symbol the same. 

var dTExt = "";  

Toybox.System.println( ((dTExt.equals("") ))  );  


  • I've tested the following code with several SDKs (3.1.8, 3.2.5, and 4.0.0.preview1) and it reports true for all four cases.

    var dTExt = "";
    System.println(dTExt.equals(dTExt));
    System.println(dTExt.equals(""));
    System.println("".equals(dTExt));
    System.println("".equals(""));

    I also tested with the the multi-byte utf-8 string "aфᐃ" and got the expected results there as well. Here is information on those code points.

    | Glyph     | Escape   |   Code Point | Unicode Name                       |
    |:----------|:---------|-------------:|:-----------------------------------|
    | a  | \u0061   |           97 | LATIN SMALL LETTER A               |
    | ф  | \u0444   |         1092 | CYRILLIC SMALL LETTER EF           |
    | ᐃ  | \u1403   |         5123 | CANADIAN SYLLABICS I               |

    I'm not 100% sure that I can trust that the glyph that appears in your original message is what you intended to type. Can you tell me what character you are testing, or what the utf8 bytes for it are so that I can be sure I'm testing the same thing you are reporting?