belav / csharpier

CSharpier is an opinionated code formatter for c#.
https://csharpier.com
MIT License
1.22k stars 81 forks source link

Umlaute or Currency symbols are not preserved #1232

Closed stefannikolei closed 1 month ago

stefannikolei commented 1 month ago

We have following code:

    {
        return currencyString switch
        {
            "EUR" => "€",
            "GBP" => "£",
            "USD" => "$",
            _ => string.Empty,
        };
    }

If we use the Rider plugin this code will be produced

  public static string ToCurrencySymbol(this string currencyString)
    {
        return currencyString switch
        {
            "EUR" => "€",
            "GBP" => "£",
            "USD" => "$",
            _ => string.Empty,
        };
    }

Using the CLI gives us no problems. Also the Visual Studio Plugin does not give us this problem

belav commented 1 month ago

This was a bug with the new http version of communicaton with csharpier 0.28 not reading the result from csharpier as UTF-8. I submitted the new version to jetbrains but it may take a couple of days for them to approve it.

I added a release for the new version if you want to grab it directly - https://github.com/belav/csharpier/releases/tag/rider-1.7.1

Otherwise I think downgrading to 1.6.4 should also work.