Ergebnis 1 bis 2 von 2

Thema: PQerrorMessage doesn't consider PQsetClientEncoding

  1. #1
    Petro ist offline Neuer Benutzer
    Registriert seit
    16.06.2009
    Beiträge
    10

    Standard 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?

  2. #2
    ads
    ads ist offline Super-Moderator
    Registriert seit
    08.02.2006
    Ort
    MD
    Beiträge
    4.056

    Standard

    What is the return value of PQsetClientEncoding?
    Xandrian: Kurz gesagt: Du hast ein falsches Konzept und willst nicht auf ads hören

    Jetzt NEU: PostgreSQL - Datenbankpraxis für Anwender, Administratoren und Entwickler

    PostgreSQL Service & Support

Ähnliche Themen

  1. Server doesn't listen
    Von WolfgangLucht im Forum Installation von PostgreSQL
    Antworten: 24
    Letzter Beitrag: 30.06.2011, 09:31
  2. Frage Server doesn't listen :(
    Von Beetle im Forum Sonstige Installationsprobleme
    Antworten: 12
    Letzter Beitrag: 06.07.2010, 00:47
  3. Problem 8.2/Vista: Server doesn't listen
    Von MatthiasM im Forum Konfiguration
    Antworten: 5
    Letzter Beitrag: 05.09.2008, 02:59

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •  

Links: Tobias Bauer - IT- und Funkdienstleistungen   -   Bilderrahmen-kaufen.de - Der Onlineshop für Bilderrahmen & Fotorahmen   -   Funkforum