Skip to content

Misbehaving RegionInfo.Name in net core vs net framework #39769

@delasource

Description

@delasource

Description

The string property RegionInfo.Name has different output on dotnet framework vs dotnet core. This seems to be a bug.

When using the string-parameter constructor like new RegionInfo("de-CH").Name in an dotnet core (3.1) app vs a framework app (4.8) the output is different.

According to the doc (see "Remarks" section) the behaviour of passing a full culture name such as "de-CH" should be that the Name Property equals to that string. This is correct in dotnet framework but not in net core.

Reproduce:

Write a minimal program like following and compile for framework and core

static void Main(string[] args) {
    Console.WriteLine(new RegionInfo("de-CH").Name);
    // output should be "de-CH"
    // output in fx 4.8 is "de-CH"
    // output in core 3.1 is "CH"
}

Configuration

Tested builded with 4.7.2, 4.8 (correct behavior) and net core 2.2 and 3.1 (both wrong behaviour).

Running Windows 10 Pro 2004 with net core sdk 3.1.301 and net framework 4.8 dev pack installed.

Regression

Correct behaviour in Framework (4.7.2, 4.8), not in core (2.2 and 3.1).

Other information

  • Maybe related to but not the same as 17362

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.GlobalizationquestionAnswer questions and provide assistance, not an issue with source code or documentation.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions