ppkarwasz opened a new pull request, #781: URL: https://github.com/apache/commons-io/pull/781
Different filesystems and operating systems measure file and path lengths in different units: * macOS and Windows filesystems typically count **UTF-16 code units**. * Linux and other UNIX filesystems typically count **bytes**. This change introduces explicit unit support so these limits can be interpreted consistently. ### Key changes * **New API** * Added a `LengthUnit` enum and `FileSystem.getLengthUnit()` to expose the unit of measure used by `getMaxFileNameLength()` and `getMaxPathLength()`. * Added new overloads for `isLegalFileName` and `toLegalFileName` that accept a `Charset`, making conversions between bytes and UTF-16 explicit. * **Adjusted defaults** * Reduced the `GENERIC` filesystem defaults: * File name length → **1020 bytes** (covers 255 UTF-16 characters encoded as up to 3 UTF-8 bytes). * Path length → **1 MiB** (covers 32,767 UTF-16 code units, again at 3 UTF-8 bytes each). * **Testing** * Added unit tests to validate the new API and updated limits. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org