[MPlayer-cvslog] r23245 - in trunk: cfg-mplayer.h libmenu/menu.c

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Thu May 10 18:39:55 CEST 2007


Hello,
On Thu, May 10, 2007 at 11:05:12AM -0400, Rich Felker wrote:
> On Mon, May 07, 2007 at 06:33:30PM +0200, Reimar Döffinger wrote:
> > On Mon, May 07, 2007 at 05:55:59PM +0200, ben wrote:
> > [...]
> > > +static int get_next_char(char **txt)
> > > +{
> > > +  int c;
> > > +  c = (unsigned char)*(*txt)++;
> > > +  if (c >= 0x80) {
> > > +    if (menu_utf8){
> > > +      if ((c & 0xe0) == 0xc0)    /* 2 bytes U+00080..U+0007FF*/
> > > +        c = (c & 0x1f)<<6 | ((unsigned char)*(*txt)++ & 0x3f);
> > > +      else if((c & 0xf0) == 0xe0){ /* 3 bytes U+00800..U+00FFFF*/
> > > +        c = (((c & 0x0f)<<6) | ((unsigned char)*(*txt)++ & 0x3f))<<6;
> > > +        c |= ((unsigned char)*(*txt)++ & 0x3f);
> > > +      }
> > > +    } else if (menu_unicode)
> > > +      c = (c<<8) + (unsigned char)*(*txt)++;
> > > +  }
> > > +  if (!c) c++; // avoid UCS 0
> > > +  return c;
> > 
> > Please try to reuse utf8_get_char or libavutil GET_UTF8, this code is an
> > ugly mess and probably also less robust.
> 
> Also this should not be a configure option, or at least the default
> should be taken from the system configuration. Having to manually
> "enable utf-8" in every application is utterly broken. Menu should use
> whatever the configured internal charset of MPlayer is.

To be honest I actually don't see what the point is in supporting
non-utf8 here...

Greetings,
Reimar Döffinger



More information about the MPlayer-cvslog mailing list