hi all. ran into a problem with long filenames. some files have character lengths over 255 bytes in utf-8 encoding. How to find these files in bulk and change the name encoding like Windows-1251?
I’m assuming you’re talking about characters - not bytes, right?
What does that mean? How do you know how Windows encodes the file names internally?
What kind of problem do you actually try to solve? Currently supported Windows versions do not have any problems with path lengths longer than 256 characters.
You may try to activate the “longPathSupport” for Win32 apps if it’s not done yet:
If that’s not your issue you may elaborate a little more detailed and show some sample data (formatted as code please)
good afternoon. The problem arises with transferring files from windows to linux, I transfer files whose names contain Cyrillic, one Cyrillic letter is 2 bytes and not 1 like Latin. Linux refuses to accept such files whose names are longer than 255 bytes. but you cannot change the name of the files as they are linked to the workflow system. so I should try to change the encoding of the name to fit 255 bytes.
To be honest - I have no idea what you’re talking about. Sorry. ![]()
I’d expect that modern Windows and Linux systems support actually almost any unicode character for file names. Did you try to install an appropriate display language für you Windows - and maybe for the Linux you’re unsing as well?
no display problems. just Cyrillic letters take up two bytes per character in UTF-8 encoding.
Of these, the title contains:
102 Cyrillic characters
15 spaces
37 English characters at the end _5778ad0d-7e15-4e50-acf1-d7b4f949.pdf
Let’s summarize:
102*2+15+37=256
such long names, and there is a problem with copying them to Linux.
so the idea is to change the encoding to another that supports cyrillic and counts one cyrillic letter as one byte instead of two.
The limits are hardcoded, as are the encodings in NTFS. I have a couple of suggestions, neither tested:
Attach an NTFS formatted disk to your Linux system.
Attach a FAT32 volume to your Windows machine, copy the files to that, then copy to Linux.