Skip to content

SetCultureAttribute: CultureInfo ctor should use default culture settings #2213

@Lette

Description

@Lette

The CultureInfo constructor's useUserOverride argument defaults to true (source), which has the unfortunate effect that if you call new CultureInfo("en-US") while on an OS that is set to use user-modified en-US regional settings, those modifications will get picked up. This leads to code that picks up different settings depending on which computer you run it on. By setting useUserOverride to false the problem goes away and you'll always get a fresh set of default settings for the requested culture.

This applies to both SetCultureAttribute.cs and SetUICultureAttribute.cs.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions