Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 162 for Punycode (0.26 sec)

  1. okhttp/src/main/kotlin/okhttp3/internal/idn/Punycode.kt

     * limitations under the License.
     */
    package okhttp3.internal.idn
    
    import okio.Buffer
    import okio.ByteString.Companion.encodeUtf8
    
    /**
     * An [RFC 3492] punycode decoder for converting ASCII to Unicode domain name labels. This is
     * intended for use in Internationalized Domain Names (IDNs).
     *
     * This class contains a Kotlin implementation of the pseudocode specified by RFC 3492. It includes
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 03 03:04:50 GMT 2024
    - 8.5K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/internal/idn/PunycodeTest.kt

        )
        assertNull(
          Punycode.encode(a1000MaxCodePoint.repeat(2)),
        )
      }
    
      @Test fun invalidPunycode() {
        assertNull(Punycode.decode("xn--ls8h="))
      }
    
      private fun testEncodeDecode(
        unicode: String,
        punycode: String,
      ) {
        assertEquals(unicode, Punycode.decode(punycode))
        assertEquals(punycode, Punycode.encode(unicode))
      }
    
      private fun testDecodeOnly(
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.3K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/net/InternetDomainNameTest.java

    public final class InternetDomainNameTest extends TestCase {
      private static final InternetDomainName UNICODE_EXAMPLE =
          InternetDomainName.from("j\u00f8rpeland.no");
      private static final InternetDomainName PUNYCODE_EXAMPLE =
          InternetDomainName.from("xn--jrpeland-54a.no");
    
      /** The Greek letter delta, used in unicode testing. */
      private static final String DELTA = "\u0394";
    
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Tue Mar 05 13:16:00 GMT 2024
    - 17.3K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/UrlComponentEncodingTester.kt

          encodings[ 0x1f] = encoding // Unit Separator
          encodings[ 0x7f] = encoding // Delete
        }
    
      fun nonAscii(encoding: Encoding) =
        apply {
          encodings[UNICODE_2] = encoding
          encodings[UNICODE_3] = encoding
          encodings[UNICODE_4] = encoding
        }
    
      fun test(component: Component) =
        apply {
          for ((codePoint, encoding) in encodings) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 12.3K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/WebPlatformToAsciiTest.kt

          // OkHttp does not reject invalid Punycode.
          "xn--a",
          "xn--a.ß",
          "xn--a.xn--zca",
          "xn--a-yoc",
          // OkHttp doesn't reject U+FFFD encoded in Punycode.
          "xn--zn7c.com",
          // OkHttp doesn't reject a U+200D. https://www.rfc-editor.org/rfc/rfc5892.html#appendix-A.2
          "xn--1ug.example",
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.5K bytes
    - Viewed (0)
  6. okhttp/src/test/resources/web-platform-test-toascii.json

        "output": "x..xn--zca"
      },
      {
        "comment": "Invalid Punycode",
        "input": "xn--a",
        "output": null
      },
      {
        "input": "xn--a.xn--zca",
        "output": null
      },
      {
        "input": "xn--a.ß",
        "output": null
      },
      {
        "input": "xn--ls8h=",
        "output": null
      },
      {
        "comment": "Invalid Punycode (contains non-ASCII character)",
        "input": "xn--tešla",
        "output": null
    Json
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Dec 20 23:27:07 GMT 2023
    - 5.2K bytes
    - Viewed (0)
  7. okhttp/src/main/kotlin/okhttp3/internal/-HostnamesCommon.kt

      }
    
      // 2. Normalize, from bufferB to bufferA.
      val normalized = normalizeNfc(bufferB.readUtf8())
      bufferA.writeUtf8(normalized)
    
      // 3. For each label, convert/validate Punycode.
      val decoded = Punycode.decode(bufferA.readUtf8()) ?: return null
    
      // 4.1 Validate.
    
      // Must be NFC.
      if (decoded != normalizeNfc(decoded)) return null
    
      // TODO: Must not begin with a combining mark.
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 11.2K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/net/InternetDomainNameTest.java

    public final class InternetDomainNameTest extends TestCase {
      private static final InternetDomainName UNICODE_EXAMPLE =
          InternetDomainName.from("j\u00f8rpeland.no");
      private static final InternetDomainName PUNYCODE_EXAMPLE =
          InternetDomainName.from("xn--jrpeland-54a.no");
    
      /** The Greek letter delta, used in unicode testing. */
      private static final String DELTA = "\u0394";
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Tue Mar 05 13:16:00 GMT 2024
    - 17.3K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/CookieTest.kt

        val unicode = "https://長.長.長崎.jp".toHttpUrl()
        assertThat(parse(unicode, "a=b; domain=長.長崎.jp")).isNotNull()
        assertThat(parse(unicode, "a=b; domain=長崎.jp")).isNull()
        val punycode = "https://xn--ue5a.xn--ue5a.xn--8ltr62k.jp".toHttpUrl()
        assertThat(parse(punycode, "a=b; domain=xn--ue5a.xn--8ltr62k.jp")).isNotNull()
        assertThat(parse(punycode, "a=b; domain=xn--8ltr62k.jp")).isNull()
      }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 24.3K bytes
    - Viewed (0)
  10. okhttp/src/main/kotlin/okhttp3/internal/publicsuffix/PublicSuffixDatabase.kt

       * ```
       *
       * @param domain A canonicalized domain. An International Domain Name (IDN) should be punycode
       *     encoded.
       */
      fun getEffectiveTldPlusOne(domain: String): String? {
        // We use UTF-8 in the list so we need to convert to Unicode.
        val unicodeDomain = IDN.toUnicode(domain)
        val domainLabels = splitDomain(unicodeDomain)
    
        val rule = findMatchingRule(domainLabels)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 11.7K bytes
    - Viewed (0)
Back to top