Subject: Re: CVS commit: src/sys/dev/usb
To: Tom Spindler <dogcow@babymeat.com>
From: Eric Haszlakiewicz <erh@nimenees.com>
List: tech-kern
Date: 03/01/2007 17:09:33
On Thu, Mar 01, 2007 at 09:17:48AM -0800, Tom Spindler wrote:
> > 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.

eric