clalancette / pycdlib

Python library to read and write ISOs
GNU Lesser General Public License v2.1
147 stars 38 forks source link

pycdlibexception.PyCdlibInvalidInput('Joliet names can be a maximum of 64 characters') #121

Open j-deng opened 10 months ago

j-deng commented 10 months ago

Hello! From https://en.wikipedia.org/wiki/Talk%3AJoliet_(file_system), the name limit is 128 bytes? Unable to pack Kylin linux OS for the 64 chars error.

Joliet does extend ISO 9660 as regards file/directory name length (31 -> 128) and directory hierarchy depth (8 to no stated limit -- but can be at most 120).

ds-sloth commented 8 months ago

This limit is compliant with the standard. Joliet implementations generally represent filenames with UTF-16. This encodes most Unicode codepoints as 2 bytes, and encodes high codepoints (such as emoji or some CJK characters) as 4 bytes.

For practical purposes, this means that each codepoint ("character") will require at least two bytes. See the following passage from ECMA-119 (https://www.ecma-international.org/wp-content/uploads/ECMA-119_4th_edition_june_2019.pdf, page 63):

"The File or Directory Identifiers may be up to 128 bytes (64 unicode characters) in length."

It's possible that one can get this use case to work by enabling Rock Ridge and disabling Joliet, but I haven't used this library myself so can't say whether that would help.