Пример #1
0
        static bool GetGlobalizationInvariantMode()
        {
            var val = Environment.GetEnvironmentVariable("DOTNET_SYSTEM_GLOBALIZATION_INVARIANT");

            if (val != null)
            {
                return(Boolean.IsTrueStringIgnoreCase(val) || val.Equals("1"));
            }
            return(LoadICU());
        }
        static bool GetInvariantSwitchValue()
        {
            var val = Environment.GetEnvironmentVariable("DOTNET_SYSTEM_GLOBALIZATION_INVARIANT");

            if (val != null)
            {
                return(Boolean.IsTrueStringIgnoreCase(val) || val.Equals("1"));
            }
            return(false);
        }
Пример #3
0
        static bool GetGlobalizationInvariantMode()
        {
            var val = Environment.GetEnvironmentVariable("DOTNET_SYSTEM_GLOBALIZATION_INVARIANT");

            if (val != null)
            {
                return(Boolean.IsTrueStringIgnoreCase(val) || val.Equals("1"));
            }
            int res = Interop.Globalization.LoadICU();

            if (res == 0)
            {
                string message = "Couldn't find a valid ICU package installed on the system. " +
                                 "Set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support.";
                Environment.FailFast(message);
            }
            return(false);
        }