[MPlayer-dev-eng] [PATCH] subreader: recode the whole file to utf-8 before parsing

Zuxy Meng zuxy.meng at gmail.com
Tue May 29 17:25:19 CEST 2007


Hi,

2007/5/29, Evgeniy Stepanov <eugeni.stepanov at gmail.com>:
> Hi,
>
> this patch changes the way subtitle recoding takes place. Instead of recoding
> each 'struct subtitle', the whole file is read into memory, recoded to utf-8,
> and a stream is created with new_memory_stream.
>
> This patch was created as an attempt to resolve the problem with BOM in the
> beginning of a unicode subtitle file. The problem is not solved yet, but it
> is easy now, and will be done in a separate patch. As a side effect, which is
> arguably more important, it allows to read UTF-16 encoded subtitles.
>
> Subtitle related code at the beginning of subreader.c is unused now and can be
> removed.
>
> All in all, it seems like the right thing to do. Opinions ?

I've tested your patch with enca and ucs-2le/ucs-2be encoded subtitles
and it works great! Thanks!

BTW is libass the right place to put the code?
-- 
Zuxy
Beauty is truth,
While truth is beauty.
PGP KeyID: E8555ED6



More information about the MPlayer-dev-eng mailing list