Title: RE: Roundtripping Solved

Arcane Jill wrote:

> #    for all possible octet sequences s:
> #        length of (UTF-8(f(s)) <= length of s,

No, that is not the requirement. It is:

bytelength(f(s)) <= 2*bytelength(s)

> I'm aware that you're trying to deal with a real issue here,
> and I have
> sympathy for that, but you really need to drop these pleas.

Thanks for trying to help, Jill. Take a break.


> > in C, you can guess (for performance resons) the maximum
> amount of memory
> > you need for a certain conversion.
>
> You can do better than guess. You figure it out exactly, to
> the byte. And
> then allocate exactly the right amount of memory you require.

I said performance reasons. Determining it exactly costs more than strlen of the source string. And when you know the max size of the source string, you don't even need to strlen it.


Lars

Reply via email to