Lars Gullik Bjønnes wrote:
Abdelrazak Younes <[EMAIL PROTECTED]> writes:
| That's exactly what this means but, sure, that is just my opinion. You
| obviously are in love with your vector solution ;-)
If the only semantics are "bunch of bytes" etc. then a vector is
correct.
Sure but in this case the end-result is a lot of copied data and a lot
of conversion from/to docstring that could be saved. When the time comes
to optimisation, you will see what I mean.
For passing ucs-4 strings around we already have docstring.
I know it's a bit late to voice my opinion but I think it should have been:
typedef std::basic_string<unsigned short> ucs2_string;
typedef std::basic_string<boost::uint32_t> ucs4_string;
And a compile time dependant
#ifdef USE_UCS2
typedef ucs2_string docstring
#else
typedef ucs4_string docstring
#endif
Then the unicode API would have been:
void
ucs2_to_ucs4(ucs2_string const & ucs2str, ucs4_string & ucs4str);
void
ucs4_to_ucs2(ucs4_string const & ucs4str, ucs2_string & ucs2str);
etc...