xat / castnow

commandline chromecast player
MIT License
3.81k stars 243 forks source link

subtitles should support being read with encoding #57

Open kim0 opened 9 years ago

kim0 commented 9 years ago

My subtitles are written in Arabic (Windows-1256) code-pages. Kindly allow a setting to specify the code-page to read the text file with.

As a second more advanced phase, it would be awesome to heuristically guess the file code-page and apply it by default

kim0 commented 9 years ago

Ok, what I need has landed as bb1d93f1604f08bc26f74f9cb569e463f120a56b in https://github.com/Ivshti/srt2vtt/commits/master .. @xat Would you kindly merge this and push a shiny release :)

xat commented 9 years ago

@kim0 That commit at first neededs to get merged into the official srt2vtt project ( which is not a project of mine ) over here https://github.com/deestan/srt2vtt and then get published on npm.

@Ivshti Would you mind making an Pull Request out of this to the offical project?

There is also another srt-to-vtt module by mafintosh https://github.com/mafintosh/srt-to-vtt which got published recently. I'll have a closer look at that one too.

xat commented 9 years ago

@kim0 Can you give me an download link to your arabic subtitles? That would make testing easier.

xat commented 9 years ago

@kim0 Sorry for spamming you :-D Just noticed that Arabic does not seem to be supported by the charset detection lib used in that commit. https://github.com/aadsm/jschardet

kim0 commented 9 years ago

phew /me unlucky then :) It might not magically auto-detect it, but I don't mind passing --enc cp1256 .. is that possible

kim0 commented 9 years ago

FYI, for testing you could download a sample arabic subtitles from http://subscene.com/subtitles/fury/arabic/1045421

xat commented 9 years ago

Thanks for the link. I'll implement this in v0.5

kim0 commented 9 years ago

Thanks!

HLFH commented 9 years ago

Hi @xat. I have French subtitles. Accents like é, ', à... are not supported. What could we do to solve that? Thanks in advance,

berkaytheunicorn commented 9 years ago

turkish characters also shown wrong I guess the encoding of the text should be picked automatically. and is there a way to resize subtitles