Georg Baum wrote:
Lars Gullik Bjønnes wrote:
Conversion between the different unicode encodings are pretty cheap.
Yes, but what I am more concerned about are lots of ucs4_to_utf8 or vice
versa in the code. That just makes it a bit less readable.
| Since the po
| files will eventually be in utf8 it seems natural to use utf8 for
| _(), too.
Yes. However to make us able to ignore the norm of the po files I am
going to use bind_textdomain_codeset so that we always get utf-8.
Good.
Here comes the next bit: I discovered that the result of
std::vector<char> ucs4_to_utf8(boost::uint32_t c)
was never used as a vector. I changed it to std::string, and that simplifies
the code. In particular it removes manual fiddling with the terminating
'\0', which we should not do IMHO.
Having had a closer look at "unicode.C" it seems that all use of
std::vector could be replaced by std::basic_string. We just have to
replace "push_back" with "+="...
Is there any reason why you chose std::vector Lars?
Abdel.