Invalid encoding exception in PgSqlDataReader

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
GeroL
Posts: 4
Joined: Wed 11 Apr 2012 23:31

Invalid encoding exception in PgSqlDataReader

Post by GeroL » Sat 29 Dec 2012 08:13

Hi, I get this exception:
Does a transaction have a limit in size or something like that? I tried to save special german characters like öüä. My Devart.Data.PostgreSQL file is version 6.2.114.0.
When I use PgMonitor I get this exception every 5 seconds. Very annoying.

Just tested: even the MembershipProvider has problems with the characters öäü :( There must be some wrong settings.

Code: Select all

System.Data.UpdateException occurred
  HResult=-2146233087
  Message=Fehler beim Aktualisieren der Einträge. Weitere Informationen finden Sie in der internen Ausnahme.
  Source=System.Data.Entity
  StackTrace:
       bei System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager, IEntityAdapter adapter)
       bei System.Data.Objects.ObjectContext.SaveChanges(SaveOptions options)
       bei Stars.Calculate.Helper.PlaceRandomResources(Entities dat, Planet planet, Int32 resTypeCount, Int32 minAmount, Int32 maxAmount) in x:\Stars\Stars.Game.Schema.1\Calculate\Helper.cs:Zeile 72.
  InnerException: Devart.Data.PostgreSql.PgSqlException
       HResult=-2147467259
       Message=ungültige Byte-Sequenz für Kodierung »UTF8«: 0xf6 0x74 0x65 0x73
       Source=Devart.Data.PostgreSql
       ErrorCode=-2147467259
       CallStack=""
       DetailMessage=""
       FileName=src\backend\utils\mb\wchar.c
       Hint=""
       LineNumber=2015
       Position=0
       ProcedureName=report_invalid_encoding
       StackTrace:
            bei Devart.Data.PostgreSql.PgSqlDataReader.e(Int32 A_0)
            bei Devart.Data.PostgreSql.PgSqlCommand.InternalExecute(CommandBehavior behavior, IDisposable stmt, Int32 startRecord, Int32 maxRecords)
            bei Devart.Common.DbCommandBase.InternalExecute(CommandBehavior behavior, IDisposable stmt, Int32 startRecord, Int32 maxRecords, Boolean nonQuery)
            bei Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior, Boolean nonQuery)
            bei Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior)
            bei Devart.Data.PostgreSql.Entity.j.a(CommandBehavior A_0)
            bei Devart.Common.Entity.an.b(CommandBehavior A_0)
            bei System.Data.Mapping.Update.Internal.DynamicUpdateCommand.Execute(UpdateTranslator translator, EntityConnection connection, Dictionary`2 identifierValues, List`1 generatedValues)
            bei System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager stateManager, IEntityAdapter adapter)
       InnerException:

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

Re: Invalid encoding exception in PgSqlDataReader

Post by Shalex » Sat 29 Dec 2012 13:32

Please try using the "Unicode=true;" connection string parameter.
If this doesn't help, send us the following information:
1) a small test project with the corresponding DDL/DML script to reproduce the issue in our environment;
2) the encoding of your database;
3) the Language for Non-Unicode Programs setting on the workstation where you are running the code.

GeroL
Posts: 4
Joined: Wed 11 Apr 2012 23:31

Re: Invalid encoding exception in PgSqlDataReader

Post by GeroL » Sun 30 Dec 2012 02:54

Thank you, that helped. Did not know that.

Post Reply