hi,
i have read in PostgreSQL Manual and found
"SHOW SERVER_ENCODING"
"SHOW CLIENT_ENCODING"
it does show me UTF8 or WIN1252, depend on Server, on both Side
but i can change it to
- Code: Select all Expand view RUN
cQuery := 'SET CLIENT_ENCODING TO "WIN1252"'
cENCODING := oPGU:QuickQuery( cQuery )
CONNECT2SRV( 207 ) cPGVersion = "PostgreSQL 14.1, compiled by Visual C++ build 1914, 64-bit"
CONNECT2SRV( 209 ) FWPG_ListSchemas( oPGU ) = {"pg_toast","pg_catalog","public","information_schema"}
CONNECT2SRV( 213 ) cENCODING = "UTF8"
CONNECT2SRV( 217 ) cENCODING = ""
CONNECT2SRV( 221 ) cENCODING = "WIN1252"
- Code: Select all Expand view RUN
cQuery := "SELECT version()"
cPGVersion := oPGU:QuickQuery( cQuery )
IF !EMPTY( cPGVersion )
oPGU:cVersion := cPGVersion
ENDIF
fwlog cPGVersion
fwlog FWPG_ListSchemas( oPGU )
cQuery := "SHOW SERVER_ENCODING"
cENCODING := oPGU:QuickQuery( cQuery )
fwlog cENCODING
cQuery := 'SET CLIENT_ENCODING TO "WIN1252"'
cENCODING := oPGU:QuickQuery( cQuery )
fwlog cENCODING
cQuery := "SHOW CLIENT_ENCODING"
cENCODING := oPGU:QuickQuery( cQuery )
fwlog cENCODING
now it work perfect UTF8 <-> WIN1252 and no hb_translate() is need any more
! Note : SERVER_ENCODING Setting are default for Database ( Catalog ) ... but Table itself can be different
p.s. have use TGrid() but it should work with XBROWSE too