Files
pdfcraft/crates
Osvaldo DuranandClaude Opus 5.5 5171da2d03 Count a file name's bytes, not its characters, when renaming
The rename check limited a new file name to 255 characters, but file systems
limit bytes (ext4, APFS: 255 bytes of UTF-8; NTFS: 255 UTF-16 units). A 94
character CJK name passed the check and the rename then failed.

The name is now refused when it is over 255 UTF-8 bytes or over 255 UTF-16
code units, with the same error type; the message and the tool description say
bytes. The limit constant is renamed to MAX_NAME_LEN (it had no other users).

Test: crates/engine/tests/rename_name_length.rs::a_name_over_255_bytes_is_refused; before this change it fails because a 94-character CJK name (286 bytes with the extension) was accepted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 20:59:42 -04:00
..
…
…
…
…
…