Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » Postgres library improvements
Re: Postgres library improvements [message #22606 is a reply to message #22561] Thu, 30 July 2009 22:12 Go to previous messageGo to previous message
Zbych is currently offline  Zbych
Messages: 327
Registered: July 2009
Senior Member
I've made some additional tests and it appears that code page and client language are one big mess in windows version of postgresql:

1. Before client is connected, error messages (for example when server is down) use win-1250 code page (environment variable LC_LOCALE is ignored, bug)

2. When client tries to connect, but connection is refused (for example when client has no right to connect to database), error messages use code page and language set in configuration of server (in my case utf-8)

3. When client is connected and code page is set by PQsetClientEncoding, error messages use correct code page.

I tried to fix the problem:
String PostgreSQLSession::ErrorMessage()
{
    if (PQclientEncoding(conn) >= 0) return PQerrorMessage(conn);
    return FromSystemCharset(PQerrorMessage(conn));
}

but it only solves case 1 i 3.

Any ideas how to handle this correctly?

[Updated on: Thu, 30 July 2009 22:12]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Postgresql and bool
Next Topic: Acquiring large record
Goto Forum:
  


Current Time: Sun Aug 24 22:23:42 CEST 2025

Total time taken to generate the page: 0.05324 seconds