8000 GitHub · Where software is built
[go: up one dir, main page]

Skip to content
Writing string via EF Core contains unexpected bytes #1094
Open
@stormcrow79

Description

@stormcrow79

Inserting or updating a string field using Entity Framework results in unexpected byte sequences when all of the following conditions are met:

  • the connection string specifies an encoding other than UTF-8
  • the entity contains a string property where the database column has the character set 'NONE'

Environment

  • Firebird 4.0.2 x64 on Windows
  • .NET 6
  • FirebirdSql.EntityFrameworkCore.Firebird 9.1.1
create table tests (
  id int generated by default as identity primary key,
  name varchar(50) character set none);

var connectionString = "DataSource=localhost;User=SYSDBA;Password=********;Database=employee;Character Set=ISO8859_1;";

context.Tests.Add(new Test() { Name = "Entr\u00E9e" });

Expected outcome: name contains "Entrée" with an accented e
Actual outcome: name contains "Entrée" (the UTF-8 bytes for U+00E9)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0