-
Notifications
You must be signed in to change notification settings - Fork 28
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
Correctly handle unicode chapters #58
base: master
Are you sure you want to change the base?
Conversation
Hi @throwawayay, could you provide some unicode chapter files for me to test with? |
Note that my approach is not the cleanest but it does end up needing the smallest code change. I've attached two sample files (in the "simple") chapter format. P.S. Related to internationalization - there's another issue where pymkv cannot set the character encoding on subtitles ( |
Thanks for the files, I’ll take a look here in the next few days. Also, that would be great if you can open an issue with a detailed description of the issue regarding internationalization. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be best to fully develop the --chapter-charset
option in the object so users will have more options when it comes to different charsets.
if self._chapters_file is not None: | ||
command.extend(['--chapter-charset UTF-8 --chapters', self._chapters_file]) | ||
if self._chapter_language is not None: | ||
command.extend(['--chapter-language', self._chapter_language]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of combining the --chapter-charset
option here with the --chapters
option, lets give the user more control by creating a new self._chapters_charset
variable that is stored in the MKVFile object. It can be initialized to None
when the object is created and have property methods similar to the chapter language property.
Also fixes potential bug of
Error: '--chapter-charset' must be given before '--chapters' in '--chapter-charset UTF-8'.