Ad
  • Custom User Avatar

    Wouldn't this fail in a case where the unicode value was 2 or more bytes and the first or last byte happened to be the same?
    Examples being:

    U+00E9 (LATIN SMALL LETTER E WITH ACUTE, “é”)
    • UTF‑8 encoding: 0xC3 0xA9
    U+00EA (LATIN SMALL LETTER E WITH CIRCUMFLEX, “ê”)
    • UTF‑8 encoding: 0xC3 0xAA
    

    First byte is 0xC3 for both, but they are different runes

    Failing Test case example:

    Expect(Feast("ér", "êr")).To(BeFalse(), "Testing 'ér' vs 'êr'")
    

    Could have a similar situation at the end, last bytes are equal but the runes are different