Worked example
Path lengths (UTF-16 code units): 11, 21
Inputs
- File paths, one per line: /a/file.txt /folder/long-name.txt
- Supplied maximum path length (UTF-16 code units): 15
Counts JavaScript UTF-16 code units in each supplied path, including separators.
Use the units shown.
Count code units in each complete line, without trimming path spaces.
Compare each measured path length with the supplied limit.
Take the largest measured path length.
Counts JavaScript UTF-16 code units in each supplied path, including separators. This is not a platform-path validator; supply a limit using the same counting convention.
MDN String length — UTF-16 code units ↗Path lengths (UTF-16 code units): 11, 21
Path lengths (UTF-16 code units): 11, 21