From 6ba64b570850152cba78a8f9966c220ae9c0da88 Mon Sep 17 00:00:00 2001 From: "Stephen A. Imhoff" Date: Wed, 26 Oct 2016 11:06:34 -0700 Subject: [PATCH] Remove commented-out code. --- .../src/System/Globalization/IdnMapping.cs | 56 ---------------------- 1 file changed, 56 deletions(-) diff --git a/src/mscorlib/src/System/Globalization/IdnMapping.cs b/src/mscorlib/src/System/Globalization/IdnMapping.cs index 556841e..edae8ee 100644 --- a/src/mscorlib/src/System/Globalization/IdnMapping.cs +++ b/src/mscorlib/src/System/Globalization/IdnMapping.cs @@ -133,62 +133,6 @@ namespace System.Globalization public String GetAscii(String unicode, int index, int count) { throw null; - /*if (unicode==null) throw new ArgumentNullException(nameof(unicode)); - if (index < 0 || count < 0) - throw new ArgumentOutOfRangeException((index < 0) ? "index" : "count", - Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); - if (index > unicode.Length) - throw new ArgumentOutOfRangeException("byteIndex", - Environment.GetResourceString("ArgumentOutOfRange_Index")); - if (index > unicode.Length - count) - throw new ArgumentOutOfRangeException("unicode", - Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer")); - Contract.EndContractBlock(); - - // We're only using part of the string - unicode = unicode.Substring(index, count); - - if (Environment.IsWindows8OrAbove) - { - return GetAsciiUsingOS(unicode); - } - - // Check for ASCII only string, which will be unchanged - if (ValidateStd3AndAscii(unicode, UseStd3AsciiRules, true)) - { - return unicode; - } - - // Cannot be null terminated (normalization won't help us with this one, and - // may have returned false before checking the whole string above) - Contract.Assert(unicode.Length >= 1, "[IdnMapping.GetAscii]Expected 0 length strings to fail before now."); - if (unicode[unicode.Length - 1] <= 0x1f) - { - throw new ArgumentException( - Environment.GetResourceString("Argument_InvalidCharSequence", unicode.Length-1 ), - "unicode"); - } - - // Have to correctly IDNA normalize the string and Unassigned flags - bool bHasLastDot = (unicode.Length > 0) && IsDot(unicode[unicode.Length - 1]); - unicode = unicode.Normalize((NormalizationForm)(m_bAllowUnassigned ? - ExtendedNormalizationForms.FormIdna : ExtendedNormalizationForms.FormIdnaDisallowUnassigned)); - - // Make sure we didn't normalize away something after a last dot - if ((!bHasLastDot) && unicode.Length > 0 && IsDot(unicode[unicode.Length - 1])) - { - throw new ArgumentException(Environment.GetResourceString( - "Argument_IdnBadLabelSize"), "unicode"); - } - - // May need to check Std3 rules again for non-ascii - if (UseStd3AsciiRules) - { - ValidateStd3AndAscii(unicode, true, false); - } - - // Go ahead and encode it - return punycode_encode(unicode);*/ } -- 2.7.4