[haiku-development] Re: BString method SymbolAt() proposal

  • From: Reinhard Scharnagl <ReScharn@xxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sat, 19 Jun 2010 13:17:25 +0200

Am 19.06.2010 um 12:58 schrieb Axel Dörfler:

> For one, CharAt() is a much better name in my opinion than SymbolAt(), 
> same for CountChars() vs. CountSymbols() - UTF-8 characters aren't 
> automatically symbols, and what you are interested in here are 
> characters, not symbols.

Maybe we are not using the same vocabulary. The datatype char is not
able to hold values like '€' or '…' and a lot more of them.

> Anyway, I think a method that returns a Unicode character, not a UTF-8 
> byte array, would be more appropriate. There is much for functionality 
> in this regard that would be desirable, though.

A unicode symbol could consist of several bytes - example is '€'.

BString routines and e.g. STDOUT stream routines are (still) not able to
handle such metachar (int32) values as a symbol. They either will
handle such values as integers or truncate them to their last byte.

Thus for the moment only a BString return value would do.

> Also, if you plan to work on anything like that, see 
> headers/private/interface/utf8_functions.h - that one should already 
> have everything you should need.

I am not knowing, on what you are talking about. Where in the BeBook
e.g. things could be found documented which you are addressing here?

Reinhard (Octopus)

Other related posts: