Files
tauri-plugins-workspace/.changes/fix-fs-utf16-lines.md
T
Lucas Fernandes Nogueira 5c144e7466 fix(fs): only split UTF-16 lines on aligned line feeds (#3631)
In plugins/fs/src/commands.rs read_until_bytes / LinesBytes, the line
feed sequence was matched at any byte offset, so UTF-16LE "ਗĀ"
(17 0a 00 01) or UTF-16BE "Āਗ" (01 00 0a 17) split mid code unit and every
following line was decoded misaligned.

Line feed and carriage return sequences now only match on a multiple of
their length from the start of the line. Unit tests with both examples
(they fail without the fix).
2026-10-09 13:04:09 -03:00

7 lines
239 B
Markdown

---
fs: patch
fs-js: patch
---
Fixed `readTextFileLines` with a UTF-16 encoding splitting lines on a `0x0A 0x00` (LE) or `0x00 0x0A` (BE) byte sequence that is not aligned on a code unit, e.g. `ਗĀ`, which garbled every following line.