Skip to content

CSharpier Rider plugin mangles UTF-8 characters when running on save #1213

@kaelon141

Description

@kaelon141
  • IDE Version: JetBrains Rider 2023.3.4
  • Extension Version: 1.6.3
  • CSharpier Version: 0.27.2+b456544aad8957d0e2026afe1a37544bb74552ba
  • Operating System: Windows 11
  • .csharpierrc Settings: printWidth: 120
  • .editorconfig Settings: N/A

Log Output

Steps to reproduce

  1. Ensure the csharpier plugin is installed in Rider and ensure the "Run on Save" setting is turned on in the plugin's settings.
  2. Open any .cs file
  3. Ensure the file encoding is set to UTF-8 with BOM
  4. Type any non-ascii UTF-8 character, like ë or ä
  5. Save the file.

Expected behavior
The non-ascii UTF-8 character is preserved

Actual behavior
The character is mangled. For example, ë becomes ë. Saving this again then mangles the characters again, resulting in ë.

I've narrowed this down to the CSharpier plugin in Rider, because non-ascii UTF-8 characters are preserved correctly when turning off the 'Run on Save' setting of the plugin. When running csharpier from the terminal using dotnet csharpier . --config-path ./.csharpierrc.yaml, the problem does not arise either.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions