ICU4N icon indicating copy to clipboard operation
ICU4N copied to clipboard

Unable to run Transliterator with `DOTNET_SYSTEM_GLOBALIZATION_INVARIANT="1"`

Open gnattu opened this issue 3 months ago • 1 comments

System.InvalidOperationException: Failed to compare two elements in the array.
 ---> System.TypeInitializationException: The type initializer for 'ICU4N.Text.Transliterator' threw an exception.
 ---> System.TypeInitializationException: The type initializer for 'ICU4N.Globalization.UCultureInfo' threw an exception.
 ---> System.Globalization.CultureNotFoundException: Only the invariant culture is supported in globalization-invariant mode. See https://aka.ms/GlobalizationInvariantMode for more information. (Parameter 'name')
en is an invalid culture identifier.
   at System.Globalization.CultureInfo..ctor(String name, Boolean useUserOverride)
   at ICU4N.Globalization.UCultureInfo..cctor()
   --- End of inner exception stack trace ---
   at ICU4N.Globalization.UCultureInfo.get_CurrentCulture()
   at ICU4N.Impl.ICUResourceBundle.GetBundleInstance(String baseName, String localeID, Assembly root, OpenType openType)
   at ICU4N.Impl.ICUResourceBundle.GetBundleInstance(String baseName, String localeID, Assembly root, Boolean disableFallback)
   at ICU4N.Util.UResourceBundle.<>c__DisplayClass25_0.<GetRootType>b__0(String key)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at ICU4N.Util.UResourceBundle.GetRootType(String baseName, Assembly root)
   at ICU4N.Util.UResourceBundle.InstantiateBundle(String baseName, String localeName, Assembly root, Boolean disableFallback)
   at ICU4N.Util.UResourceBundle.GetBundleInstance(String baseName, String localeName, Assembly root, Boolean disableFallback)
   at ICU4N.Util.UResourceBundle.GetBundleInstance(String baseName, String localeName, Assembly root)
   at ICU4N.Text.Transliterator..cctor()
   --- End of inner exception stack trace ---
   at ICU4N.Text.Transliterator.GetInstance(String id)

To my understanding, the transliterator should use its own culture data and run with Invariant mode?

Or am I wrong and this has to run with the culture data installed?

gnattu avatar Mar 26 '24 04:03 gnattu