mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-21 03:26:50 +00:00
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>