mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-10-10 22:38:44 +02:00
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).
7 lines
239 B
Markdown
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.
|