10

I cannot save the file with the name containing more than 127 Cyrillic UTF-8 symbols on my Ext3 filesystem. It is possible so save the files containing up to 255 English UTF-8 symbols though.

So is there a limit on a number of bytes containing the file name or the number of characters in the file name? In case of the former, one would expect even more strict limit on the file name length in Chinese, for example. Is that right?

HopelessN00b
  • 53,385
  • 32
  • 133
  • 208
v_2e
  • 329
  • 3
  • 11
  • 4
    @GioMac: No, that's not true. [UTF-8](http://en.wikipedia.org/wiki/Utf-8) uses a variable-length encoding scheme and e.g. cyrillic characters are in the two-byte range, limiting the length to 127 code points if only cyrillic letters are used. As the OP noted, other characters with three or four byte code length will limit the length more. To summarize: The maximum file name length will be between 255 and 63 characters, depending on the code points used. – Sven Sep 29 '13 at 12:03

1 Answers1

13

Yes, the maximal file name length is 255 bytes, resulting in varying max length for filenames depending on code points used and their encoding length.

Sven
  • 97,248
  • 13
  • 177
  • 225
  • 1
    Just to note, any UTF schemas can max out at 63 code points. Using the smallest code units for each schema, UTF-8 (63-255), UTF-16 (63-127), UTF-32 (63). Just for informational purposes, your answer is spot on. – Rahly May 30 '16 at 19:39