Describe the bug
main.go:2808-2815:
const maxFilenameLen = 255
if len(name) > maxFilenameLen {
ext := filepath.Ext(name)
...
name = name[:maxFilenameLen-len(ext)] + ext
}
The slice cuts at byte boundaries. If the filename is multi-byte UTF-8 (CJK, emoji, accented letters) the cut can land mid-rune, producing an invalid UTF-8 filename — which several filesystems then reject or display as ?.
Expected behavior
Trim by rune boundary using utf8.DecodeLastRuneInString so the last rune is whole.
Describe the bug
main.go:2808-2815:The slice cuts at byte boundaries. If the filename is multi-byte UTF-8 (CJK, emoji, accented letters) the cut can land mid-rune, producing an invalid UTF-8 filename — which several filesystems then reject or display as
?.Expected behavior
Trim by rune boundary using
utf8.DecodeLastRuneInStringso the last rune is whole.