[haiku-appserver] Re: moreUTF8.h

  • From: "Stephan Assmus" <superstippi@xxxxxx>
  • To: haiku-appserver@xxxxxxxxxxxxx
  • Date: Wed, 15 Jun 2005 22:58:39 +0200 CEST

Hi Axel,

> > A three byte glyph looks like this (correct me if I'm wrong):
> > 
> > 1110 ????
> > 110? ????
> > 10?? ????
> 
> That's not correct, for bytes inside the glyph, 10 is set always, 
> only 
> the other 6 bits are used for character data. The first 3 bits of the 
> first byte determines the length of the character.
> So the code looks okay, AFAICT.

I have some faint memories about reading something on UTF8 in the 
BeBook. But I cannot find it anymore.

> > So when IsInsideGlyph tests the second byte, it would return false, 
> > no? 
> > Which means moreUTF8.h only works for 2 byte glyphs. Can someone 
> > confirm? If my observation is correct, I'm going to fix the problem 
> > with count_utf8_bytes() that I introduced in my last commit. If 
> > there 
> > is a better way, speak up! :-)
> 
> Unless I am wrong, there is no need to do this :-)

Indeed. :-) Thanks for clearing this up.

Best regards,
-Stephan


Other related posts: