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

file_to_subtitles() unicode issue #1394

Closed
kempeng opened this issue Dec 29, 2020 · 2 comments
Closed

file_to_subtitles() unicode issue #1394

kempeng opened this issue Dec 29, 2020 · 2 comments
Labels
bug Issues that report (apparent) bugs. good-first-issue Especially suitable for people new to moviepy and/or programming; beginner-friendly.

Comments

@kempeng
Copy link

kempeng commented Dec 29, 2020

Not sure if this is a bug or feature request:
I was trying to create a SubtitlesClip() from a .srt file with Spanish subtitles. The special characters from the .srt did not convert properly:
([5.169, 9.06], 'a su página de inicio. Aquí encontrará todas las tareas')
was converted into:
([5.169, 9.06], 'a su página de inicio. AquÃ\xad encontrará todas las tareas')

The problem is with how the function
file_to_subtitles()
opens the srt file.

changing line 153 in subtitles.py from:
with open(filename,'r') as f:
to
with open(filename,'r',encoding="utf-8") as f:
solved the problem

@kempeng kempeng added the bug Issues that report (apparent) bugs. label Dec 29, 2020
@tburrows13 tburrows13 added the good-first-issue Especially suitable for people new to moviepy and/or programming; beginner-friendly. label Jan 12, 2021
@mondeja
Copy link
Collaborator

mondeja commented Jan 13, 2021

This was added in #1043, opened pull request to test it in #1431.

@mondeja mondeja closed this as completed Jan 13, 2021
@jgsaez9
Copy link

jgsaez9 commented Nov 14, 2023

As of today, this is not being implemented and it is essential...

At least for those of us who use Spanish

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues that report (apparent) bugs. good-first-issue Especially suitable for people new to moviepy and/or programming; beginner-friendly.
Projects
None yet
Development

No branches or pull requests

4 participants