camelToUpperSnake iterates over runes but looks ahead with s[i+1], where i is a byte index. The lookahead therefore inspects a UTF-8 continuation byte for non-ASCII input and misses the uppercase-acronym-to-lowercase boundary it is intended to recognize.
Acceptance criteria
- Add a regression test for a non-ASCII uppercase acronym followed by a lowercase word, such as a Greek or Cyrillic equivalent of
URLValue.
- Confirm the expected output includes the underscore word boundary.
- Replace byte-based lookahead with rune-safe lookahead while preserving existing ASCII and Unicode test cases.
- Run the relevant test suite.
camelToUpperSnakeiterates over runes but looks ahead withs[i+1], whereiis a byte index. The lookahead therefore inspects a UTF-8 continuation byte for non-ASCII input and misses the uppercase-acronym-to-lowercase boundary it is intended to recognize.Acceptance criteria
URLValue.