edit: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/Engine/BaseConstructor.cs;C1040664 File: BaseConstructor.cs =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/Engine/BaseConstructor.cs;C1040664 (server) 11/3/2009 11:56 AM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/Engine/BaseConstructor.cs;cul @@ -19,6 +19,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Globalization; using System.Text.RegularExpressions; using Microsoft.Scripting; using Microsoft.Scripting.Runtime; @@ -605,12 +606,12 @@ int bes = 1; double val = 0.0; for (int i = 0, j = digits.Length; i < j; i++) { - val += (double.Parse(digits[(j - i) - 1]) * bes); + val += (double.Parse(digits[(j - i) - 1], CultureInfo.InvariantCulture) * bes); bes *= 60; } return sign * val; } else { - return sign * double.Parse(value); + return sign * double.Parse(value, CultureInfo.InvariantCulture); } } =================================================================== edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/BigDecimal/BigDecimal.cs;C802353 File: BigDecimal.cs =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/BigDecimal/BigDecimal.cs;C802353 (server) 11/1/2009 11:02 PM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/BigDecimal/BigDecimal.cs;cul @@ -16,6 +16,7 @@ using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; +using System.Globalization; using System.Text; using System.Text.RegularExpressions; using Microsoft.Scripting.Math; @@ -203,8 +204,12 @@ #region Create Methods public static BigDecimal Create(Config/*!*/config, object value) { + Debug.Assert(!(value is double) && !(value is float)); // Need to use CultureInfo.InvariantCulture for double return Create(config, value.ToString(), 0); } + public static BigDecimal Create(Config/*!*/config, double value) { + return Create(config, value.ToString(CultureInfo.InvariantCulture), 0); + } public static BigDecimal Create(Config/*!*/config, string value) { return Create(config, value, 0); } @@ -236,7 +241,7 @@ if (!fraction.IsZero) { if (!string.IsNullOrEmpty(exponentStr)) { try { - exponent = int.Parse(exponentStr); + exponent = int.Parse(exponentStr, CultureInfo.InvariantCulture); } catch (OverflowException) { exponent = exponentStr.StartsWith("-") ? -1 : 1; return ExponentOverflow(config, sign, exponent); @@ -326,7 +331,7 @@ if (BigDecimal.IsNegativeZero(x)) { return -0.0; } - return Double.Parse(x.ToString(0, "", true)); + return Double.Parse(x.ToString(0, "", true), CultureInfo.InvariantCulture); } catch (OverflowException) { return Double.PositiveInfinity; } =================================================================== edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/StringFormatter.cs;C1162930 File: StringFormatter.cs =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/StringFormatter.cs;C1162930 (server) 11/1/2009 11:01 PM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/StringFormatter.cs;cul @@ -413,7 +413,7 @@ // One digit is displayed before the decimal point. Hence, we need one fewer than the precision after the decimal point int fractionDigitsRequired = (_opts.Precision - 1); - string expForm = absV.ToString("E" + fractionDigitsRequired); + string expForm = absV.ToString("E" + fractionDigitsRequired, CultureInfo.InvariantCulture); string mantissa = expForm.Substring(0, expForm.IndexOf('E')).TrimEnd(zero); // We do -2 to ignore the digit before the decimal point and the decimal point itself =================================================================== edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Hosting/RubyOptionsParser.cs;C1221149 File: RubyOptionsParser.cs =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Hosting/RubyOptionsParser.cs;C1221149 (server) 11/1/2009 10:17 PM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Hosting/RubyOptionsParser.cs;cul @@ -298,6 +298,14 @@ #endif LanguageSetup.Options["SearchPaths"] = _loadPaths; LanguageSetup.Options["RequiredPaths"] = _requiredPaths; + +#if DEBUG && !SILVERLIGHT + // Can be set to nl-BE, ja-JP, etc + string culture = Environment.GetEnvironmentVariable("IR_CULTURE"); + if (culture != null) { + System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(culture, false); + } +#endif } public override void GetHelp(out string commandLine, out string[,] options, out string[,] environmentVariables, out string comments) { ===================================================================