Skip to content

SQL Server: introduce UseUtf8() sugar to configure UTF8 properties #27624

Description

@roji

#25798 added the ability to do HasColumnType("varchar(max)").IsUnicode(true), which configures a UTF8 property on SQL Server. We could also introduce a UseUtf8() sugar (or UseUTF8() 🔥🔥🔥).

If we add it, you would be able to pass a non-UTF8 collation which is problematic. Or we'd validate the _UTF8 postfix, which would encode the SQL Server convention into EF Core - not ideal.

Note also that UseUtf8() would require the collation to be passed in, but that's only actually necessary if the user is using migrations.

Activity

  1. added this to the Backlog milestone on Mar 11, 2022
  2. AndriySvyryd commented on Mar 14, 2022

    @AndriySvyryd
    Member

    Alternatively, we could allow UseCollation to just work by allowing type mappings to understand collations, related to #7172

  3. added theissue type on Jun 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions