
On Tue, Aug 16, 2011 at 5:11 AM, Joe Mucchiello <jmucchiello@yahoo.com> wrote:
text t6(pq_some_func(), textenc::libpq());
You don't need it. You're proposing a design that tries to solve a non-existing problem. There is no such diversity of encodings in the interfaces. I don't know what is libpq, but it either uses UTF-8 in which case you write:
string t6 = pq_some_func();
I think the point here that you don't need to know the encoding of libpq. If the policy is that you use this text class and that to use it you convert it using the standard text constructor that takes the listed tag.
For libraries that use UTF-8 the conversion is a no-op. Adapting a new library to the "boost way" just involves adding a new tag to the textenc namespace and, if necessary, writing a new pair conversion routines.
Exactly.