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

Added encoding optional parameter to subtitle file loading feature #1043

Merged
merged 6 commits into from
Apr 9, 2020

Conversation

aalkz
Copy link
Contributor

@aalkz aalkz commented Nov 30, 2019

  • If this is a bugfix, I have provided code that clearly demonstrates the problem and that works when used with this PR
  • I have added a test to the test suite, if necessary
  • I have properly documented new or changed features in the documention, or the docstrings
  • I have properly documented unusual changes to the code in the comments around it
  • I have made note of any breaking/backwards incompatible changes

I had many issues with file encodings because I deal with special characters in my SRT files and this was a necessary step for me to solve them for good. It's an easy and straightforward change, but really handy if you need to specify your encoding when loading the SRT file.

Before you could only do this:
sub = SubtitlesClip("subtitles.srt", generator)

Now you can also specify your encoding if you want or need to:
sub = SubtitlesClip("subtitles.srt", generator, encoding='utf-8')

The encoding parameter is optional.

Special thanks to @Darkade for helping me figure this out.

@coveralls
Copy link

coveralls commented Nov 30, 2019

Coverage Status

Coverage decreased (-0.02%) to 64.318% when pulling 3dbc6ee on aalkz:feature/subtitles_encoding into 3fc80cb on Zulko:master.

@tburrows13 tburrows13 added the feature New addition to the API i.e. a new class, method or parameter. label Mar 10, 2020
@tburrows13 tburrows13 added this to the Release v2.0.0 milestone Mar 10, 2020
@tburrows13
Copy link
Collaborator

This is a neat feature. It took us a while to get to it, but I'm happy to merge now.

@tburrows13 tburrows13 merged commit 0523d3c into Zulko:master Apr 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New addition to the API i.e. a new class, method or parameter.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants