Before counting a large batch, test the counter with a short sample containing ASCII, an accented letter, an emoji sequence, spaces, and a newline. Compare its result with the target platform's behavior. If they differ, determine whether the discrepancy is bytes, UTF-16 units, code points, or grapheme clusters before setting a margin. Then check the real longest item. A first-pass sample catches a counting-rule mismatch before many entries are prepared incorrectly.