Page 1 of 1

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

Posted: Mon 24 Mar 2014 15:35
by GustavoAdolfo
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

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

Posted: Mon 24 Mar 2014 19:31
by GustavoAdolfo
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

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

Posted: Wed 26 Mar 2014 17:54
by Shalex
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?