[MPlayer-dev-eng] [PATCH] Recode legacy metadata (was: Moving towards UTF-8)

Zuxy Meng zuxy.meng at gmail.com
Mon Jun 25 10:16:32 CEST 2007


Hi,

2007/6/25, Reimar Doeffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de>:
> Hello,
> On Mon, Jun 25, 2007 at 01:23:25PM +0800, Zuxy Meng wrote:
> [...]
> > +    const char* fallbacks[] = {
> > +     "UTF-8",
> > +     mp_msg_charset,
>
> In 90% of cases mp_msg_charset is either set to UTF-8 or to something
> that can not be auto-detected. It has no place in this list.
> There are two kinds of charsets: Those that can be detected _reliable_ i
> most cases with > 4 characters. Those should be in this list.

What are the examples of these two kinds of charsets and how to do the
audo-detect?

> For all others think of a good fallback. I don't think there is any so
> I'd just fall back to the old behaviour.
>
> [...]
> > +     ret = iconv(cd, (const char**)&inbuf, &inlen, &outbuf, &outlen);
> > +     iconv_close(cd);
> > +     if (ret != (size_t)(-1)) {
>
> I don't think you should treat E2BIG as an error, esp. since you made
> the output buffer "only" twice as big as the input one.

Hmmm...is there a thearotical upper bound for this? I once assumed
that a 2* expansion is safe.

>
> > -                 demux_info_add(demuxer, "name", buf);
> > +                 demux_info_add(demuxer, "name",
> > +                        demux_legacy_recode(buf, tmp, 2*len));
> > +                 free(tmp);
>
> Adding this to so many places increases complexity too much.
> Make a demux_info_add_legacy function or similar to handle this instead.
> I'm not sure the "legacy" term is a good one. Maybe autoconv or similar
> would be better.

I'll consider this in next rev.

-- 
Zuxy
Beauty is truth,
While truth is beauty.
PGP KeyID: E8555ED6



More information about the MPlayer-dev-eng mailing list