[haiku-development] Re: BString and UTF-8

  • From: fano il primo <fanoilprimo@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sat, 3 Dec 2011 18:15:09 +0100

On Sat, Dec 3, 2011 at 4:26 PM, Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> wrote:

> Oliver Tappe<zooey@xxxxxxxxxxxxxxx> wrote:
> I wouldn't see a need for a dedicated BByteString (you can always use
> std::string if you really want to), but maybe a BBuffer, or even a
> BEncodedString class that supports arbitrary encodings.
> Bye,
>    Axel.
Using the Qt parlance I'd divide the real String from the Byte Array so,

   - BString contains only valid Unicode chars
   - BByteArray what do you want, raw bytes, struct and so on,,, it can
   have methods to convert from BString to other character encodings (storing
   them in BByteArray), to add raw bytes and get them... see here:

Shall it be a BChar class, too? A Class to hold unicode characters and
convert them to other encodings and so on? All Haiku API shall be changed
to support BChar class, obviously,,.
See here for QChar for inspiration:


Other related posts: