[MPlayer-dev-eng] [PATCH] subreader: recode the whole file to utf-8 before parsing
Evgeniy Stepanov
eugeni.stepanov at gmail.com
Tue May 29 20:01:33 CEST 2007
On Tuesday 29 May 2007, Zuxy Meng wrote:
> 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?
The patch simply splits ass_read_file() in 2 functions, no new code is added
to libass.
More information about the MPlayer-dev-eng
mailing list