Skip to content

Search backend: fix multibyte line match conversion

Warren Gifford requested to merge cc/multibyte-translation into main

Created by: camdencheek

This fixes a bug introduced by the multiline match code that causes the length for LineMatch to be incorrectly calculated as the number of bytes rather than the number of runes.

Before:

Screen Shot 2022-06-01 at 12 04 44

After:

Screen Shot 2022-06-01 at 12 04 24

The apostrophe in Don't is a multibyte character, which is what caused the breakage here.

Test plan

Added a test to check behavior for multibyte characters on internal lines.

Merge request reports

Loading