@cityjson/flatcitybuf
    Preparing search index...

    Function compareFullStrings

    • Compares two FULL, untruncated attribute values as UNSIGNED UTF-8 bytes.

      Never a < b on the JS strings. JS relational operators compare UTF-16 CODE UNITS, which disagrees with UTF-8 byte order for supplementary-plane text: '。' < '\u{10000}' is false in JS (0xFF61 > 0xD800) but the byte comparison says '。' (EF BD A1) sorts before '\u{10000}' (F0 90 80 80). Every ASCII test passes either way, which is exactly what makes the wrong version survive review. compareKeys in static-btree/key.ts already compares keys byte-wise for the same reason; this is the same rule applied to the untruncated value.

      Parameters

      • a: string
      • b: string

      Returns number