Skip to content

[wasm] GlobalizationMode.Invariant should not eat LoadICU errors on Browser #49391

@eerhardt

Description

@eerhardt

See the discussion in

#49073 (comment)
#49073 (comment)
#49073 (comment)

int loaded = Interop.Globalization.LoadICU();
if (loaded == 0 && !OperatingSystem.IsBrowser())
{
// This can't go into resources, because a resource lookup requires globalization, which requires ICU
string message = "Couldn't find a valid ICU package installed on the system. " +
"Please install libicu using your package manager and try again. " +
"Alternatively you can set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support. " +
"Please see https://aka.ms/dotnet-missing-libicu for more information.";
Environment.FailFast(message);
}
// fallback to Invariant mode if LoadICU failed (Browser).
return loaded == 0;

On Browser, if LoadICU() fails, we should call Environment.FailFast just like any other platform. We shouldn't fallback to Invariant mode.

cc @lewing @EgorBo @tarekgh @safern

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions