I believe we should use low bits for tagging. It will make switch
case much faster.

If you still emphasize on speed, we can make

0x05 => UTF-8
0x06 => UTF-16
0x07 => UTF-32

#define IS_UTF_ANY(a) \
    (((a)->flags & 0x07) >= UTF-8)

However, I don't believe it is needed.

Hong

> If your interest is in speed alone, then adding UTF_16 might offer options
as
> well:
> FORMAT (enc_flags):
> 7|6|5|4|3|2|1|0
> x x 0 0 1 x x x = UTF_8
> x x 0 1 0 x x x = UTF_16
> x x 1 0 0 x x x = UTF_32
> then:
>
> #define UTF 56
>
> utf_encoding = UTF & enc_flags;
> if( utf_encoding ) {
>    cout << "String is UTF_" << utf_encoding << "\n";
> }
> (excuse any code errors, I haven't CPLUSPLUSed in awhile)
> Grant M.
>
>

Reply via email to