Problem with encoding

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
guialv
Posts: 3
Joined: Tue 09 Feb 2010 15:23

Problem with encoding

Post by guialv » Tue 09 Feb 2010 15:45

I have a database with encoding latin1 and the client_encoding=latin1.
I can insert data to the database directly without problems but I can't do it from my .NET application using dotConnect for PostgreSQL. I must insert special characters like ñ or accented vowels (á, é, etc).
I read that I should set the unicode property to true in the object PgSqlConnection but do not know how I can do it because I am using an ObjectContext object of ADO.NET 3.5
Help me please

Shalex
Site Admin
Posts: 8245
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Wed 10 Feb 2010 11:22

When you are generating Devart Entity Model, the connection string used by your ObjectContext is stored at the *.config file of your application. Please add the Unicode=true; parameter to your connection string and notify us about the results.

guialv
Posts: 3
Joined: Tue 09 Feb 2010 15:23

Post by guialv » Mon 15 Feb 2010 15:23

connectionstring="...unicode=true". Now the error always is "invalid byte sequence for encodign "UTF8". Database encoding = latin1. client_encoding=latin1 in postgres.conf. Help me please

guialv
Posts: 3
Joined: Tue 09 Feb 2010 15:23

Post by guialv » Mon 15 Feb 2010 15:33

Problem resolved. I put rtf content in a RichTextBox and after save this content from the .rtf property of the richtextbox object to the database.
Thank you for help.

Post Reply