2

I'm using the Pervasive SQL - ADO.NET 3.5 DataProvider for retrieving data out of the PSQL DB and I've noticed that the german umlauts (äöüÄÖÜ etc.) are not represented correctly in the PSQLDataReader, but in the Pervasive Control Center (similar to the sql management studio) the umlauts are all correct.

Is there anything similar to the TSQL "SET LANGUAGE"-command? I havn't found something like that for Pervasive SQL.

Googling this issue wasn't successful at all, too. Although I did find some tips with a file called upper.alt or collate.cfg, but don't know how to use this files and I coudn`t find them in my installation. (I'm totally new to Pervasive...)

I hope that someone on here could help me with that.

Thanks in advance

--EDIT

I sovled it in code, like so:

var ort = reader["Ort"].ToString().Trim();
var bytes = Encoding.Default.GetBytes(ort);
ort = Encoding.GetEncoding(850).GetString(bytes);   
cordellcp3
  • 3,557
  • 1
  • 17
  • 14

1 Answers1

2

Does your Database have an alternate Code Page set in the PCC? If so, you'll probably need to specify an "Encoding=" on the ADO.NET connection string.

mirtheil
  • 8,952
  • 1
  • 30
  • 29
  • That`s the way I solved it, encoding works fine, but just wanted to know how do I achieve this with PSQL. – cordellcp3 Mar 21 '11 at 06:42
  • You can specify the Encoding parameter on the connection string. For example: PsqlConnection conn = new PsqlConnection("ServerDSN=DEMODATA;ServerName=localhost;Encoding=850"; – mirtheil Mar 21 '11 at 13:45