In my application I'm having trouble fetching the data in the PostgreSQL database, accented words being retrieved from the database and dealing with DataReader
are coming poorly formatted as in the image below.
- In the correct formatted database
- Beingreadin
DataReader
The Encoding of the bank is in UTF8 and the Character type is Portuguese_Brazil.1252 if it helps.
I'm reading the data as follows:
var command = new NpgsqlCommand("Select * from Empresa", con);
con.Open();
NpgsqlDataReader dr = command.ExecuteReader();
while (dr.Read())
{
Empresa e = new Empresa();
e.IdEmpresa = Convert.ToInt32(dr["id_empresa"]);
e.NomeFantasia = dr["nome_fantasia"].ToString();
}
Here is the image to better demonstrate the language that my database is: