Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An error occurred When inputted Chinese characters for vol_ident #75

Open
abcmouse opened this issue Nov 16, 2021 · 7 comments
Open

An error occurred When inputted Chinese characters for vol_ident #75

abcmouse opened this issue Nov 16, 2021 · 7 comments

Comments

@abcmouse
Copy link

An error occurred When inputted Chinese characters for vol_ident. Message as follows:

File "\site-packages\pycdlib\utils.py", line 135, in encode_space_pad
output = instr.decode('utf-8').encode(encoding)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-3: ordinal not in range(128)

@clalancette
Copy link
Owner

So it's an interesting case. Ecma-119 (which is the same as ISO9660) says that the Volume Identifier field must be "d-characters". In Ecma-119 jargon, d-characters are the ASCII characters 0-9, A-Z (upper case only), and underscore. So the original standard doesn't actually allow for this, and that is what pycdlib currently implements.

That said, it is likely that some utilities violate the standard and allow this. It is also possible that UDF allows this (although vol_ident isn't properly plumbed through to the UDF stuff anyway).

Out of curiousity, do you have examples of software that allows Chinese characters to be specified for vol_ident, and examples of software that will read and display it back properly?

@abcmouse
Copy link
Author

Thanks for you reply.
I know UltraISO can do this.
2021-11-18_152326

@clalancette
Copy link
Owner

Hm, that's interesting. I just downloaded Ultra ISO (the English version), and I'm trying to create an ISO with Chinese characters, but it won't let me do it. I always get mojibake. In the screenshot above, are you creating an ISO or opening an existing one? If you are opening an existing one, can you point me to the software that created the ISO initially? If you are creating an ISO, what version of Ultra ISO are you using (and which language version did you download)?

@abcmouse
Copy link
Author

Yes, I created an ISO file with UltraISO, saved it and opened it again. UltraISO can well support Chinese characters, which maybe the reason is I use the Chinese operating system. The multilanguage UltraISO version is ver 9.7.6.3829.

@basharbachir
Copy link

didnt solve yet ?

@clalancette
Copy link
Owner

didnt solve yet ?

Sorry, I should have updated this. I tried to use UltraISO a few different times, but I was never able to convince it to accept anything but ASCII characters in the VOL_IDENT field. If someone can provide me with a sample ISO that has the problem, I can take a look.

@changlichun
Copy link

It seems Chinese characters still not work.
image
20240709_094731.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants