Subject: Re: CVS commit: src/sys/dev/usb
To: Eric Haszlakiewicz <erh@nimenees.com>
From: Tom Spindler <dogcow@babymeat.com>
List: tech-kern
Date: 03/01/2007 16:38:18
> > > size_t utf8_to_utf16(uint16_t *out, size_t outlen,
> > > const char *in, size_t inlen,
> > > int flags, int *errcountp);
> >
> > Why bother specifying inlen? If you copy out at most outlen chars...
>
> Is there a fixed n bytes-per-char to m bpc ratio between utf8 and utf16
> for all characters? If not, then you can't calculate outlen just using
> inlen, so you need to specify both if you want to make sure you don't
> overrun the end of one of the buffers.
I'm talking about eliminating inlen, not outlen. It's also ambiguous,
IMHO, as to what measure inlen and outlen are measuring - number of
glyphs? bytes?