[MPlayer-dev-eng] [PATCH] UTF-8 osd messages

Ivan Kalvachev ikalvachev at gmail.com
Fri Apr 28 09:46:10 CEST 2006


2006/4/28, Adam Tlałka <atlka at pg.gda.pl>:
> On Tue, Apr 25, 2006 at 02:56:59PM +0200, Reimar D�ffinger wrote:
> > Hi,
> > On Tue, Apr 25, 2006 at 09:54:02AM +0300, Ivan Kalvachev wrote:
> > > 2006/4/23, Reimar Döffinger <Reimar.Doeffinger at stud.uni-karlsruhe.de>:
> > > > Also, the utf8_get_char function is a bit overkill for this, since it will
> > > > always encouter valid UTF-8 in this case, but I made it more flexible in
> > > > the hope in will be used in other place as well in the future.
> > >
> > > I think this is going to be the second utf-8 parser in that file, as
> > > subs are (usually) already utf-8.
> > > Take a look of vo_update_text_sub::382
> >
> > I know, but that code could in case of invalid encoding skip the terminating
> > NULL and cause a segfault. Thus it is unsuitable for most cases, and this is
> > actually one of the utf8-parsers I'd like to replace.
> >
> What about storing strings internally in UCS-2?
> Parse once when reading so there will be no need to recode UTF-8 ->
> UCS-2 before displaying.

If I remember right UCS-2 is 2 byte unicode. Unfortunately the Unicode
standard wasn't finished at the time M$ created that. It was finally
decided that full unicode is 4 bytes (Of course not the whole range is
used). This requiring some hacks to be made to support UCS-2 (this is
what Rathann is referring when pointing the UTF-16).

Using fixed size characters may have some benefits, but in our case we
don't need it.


More information about the MPlayer-dev-eng mailing list