PQerrorMessage doesn't consider PQsetClientEncoding

Hi, I am setting the libpq client encoding via PQsetClientEncoding() to “utf8”. Unfortunately, PQerrorMessage() does not seem to deliver the error text in that encoding. If, for instance, PQsetdbLogin fails for a specific (non-existing) database, the returned PQerrorMessage is: “FATAL: Database »test« does not exist” ^ > chevron open (1252-codepage: 0xbb) You see, the database name is enclosed in opening and closing chevrons (I hope my posting preserves them). But the encoding of these characters is NOT UTF8, it is (in my case) according to the Windows 1252 codepage. The correct utf8-encoding would be the double byte character 0xc2ab for the opening chevron. Hence the further processing of this string will produces non-displayable characters, e.g. the conversion to UTF16 via MultiByteToWideChar(CP_UTF8,…). It seems to me as if PQerrorMessage() doesn’t consider the PQsetClientEncoding()-setting at all. Am I right? Could this considered being a bug?

What is the return value of PQsetClientEncoding?