Error when trying execute context.SaveChanges(): \"UTF8\": 0xe3 0x6f"

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
GustavoAdolfo
Posts: 4
Joined: Thu 21 Nov 2013 13:46

Error when trying execute context.SaveChanges(): \"UTF8\": 0xe3 0x6f"

Post by GustavoAdolfo » Mon 24 Mar 2014 15:35

I'm start using Devart.Data 5.0.907.0 - Devart.Data.Postgresql 7.3.115.0 - Devart.Data.PostgreSql.Entity 7.3.115.6 and get a error about invalid bytes sequences for codification "UTF8": 0xe3 0x6f when execute SaveChanges with referent DbContext.
I have setted "Unicode=true" in connectionstring section but this not solve the problem.

This is the SQL generated from Devart for a insert:

Code: Select all

INSERT INTO public.tab_logcad(tabela, idreg, idopera, acao, motivo, "data", hora, maquina, tabelapai, idregpai) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING id
(see the "data" parameter with quotation marks, without "unicode=true" the quotatin are preced with a / character escape)

And until the proper error message is returned with bad foramation:

Code: Select all

sequência de bytes é inválida para codificação "UTF8": 0xe3 0x6f
thanks for help

GustavoAdolfo
Posts: 4
Joined: Thu 21 Nov 2013 13:46

Re: Error when trying execute context.SaveChanges(): \"UTF8\": 0xe3 0x6f"

Post by GustavoAdolfo » Mon 24 Mar 2014 19:31

On my tests cases, I have recreated the database with the same encoding configuration of the operational system and the error stopped. But, in real situation this is not possible. I can not change all databases of all clients really.
Have a form/way of configure the encoding in dotcover classes, or manipulling your strings transmited for the EF?

thanks

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

Re: Error when trying execute context.SaveChanges(): \"UTF8\": 0xe3 0x6f"

Post by Shalex » Wed 26 Mar 2014 17:54

GustavoAdolfo wrote:sequência de bytes é inválida para codificação "UTF8": 0xe3 0x6f
Please turn on the dbMonitor tool and make sure that the connection string of the connection, which is associated with the command which executes the INSERT statement, does include the "Unicode=true;" entry.
GustavoAdolfo wrote:On my tests cases, I have recreated the database with the same encoding configuration of the operational system and the error stopped.
Do you mean that the same application works in your local environment? Are encodings of your local and production PostgreSQL servers the same?

Post Reply