[haiku-development] Re: Font Encoding

Le 16 févr. 2011 à 10:56, Ingo Weinhold a écrit :
>> 
>> iconv (and ICU) need to open then close the context. With this API, we
>> don't know when to close the context, which has two problems :
> 
> But that is, as Michael said, just a problem of our implementation. No one 
> forces us to use iconv or ICU to convert between UTF-* and UTF-8. We need 
> only 21 bits to represent a Unicode code point and have 32 state bits 
> available. So there should be sufficient space for the algorithm to cache 
> the not-yet-processed bits of the current/next character, which I believe 
> is all that's needed to convert between different Unicode encodings.

This doesn't solve the pending chars issue though...
We discussed this some time ago but didn't find a solution.

Maybe we could agree that calling the thing with a NULL input buffer means 
close the context and flush the remaining chars ?

Wouldn't fix existing binaries but would keep the API.

François.

Other related posts: