diff --git a/core/modules/system/tests/modules/path_encoded_test/path_encoded_test.info.yml b/core/modules/system/tests/modules/path_encoded_test/path_encoded_test.info.yml
new file mode 100644
index 0000000..37208e9
--- /dev/null
+++ b/core/modules/system/tests/modules/path_encoded_test/path_encoded_test.info.yml
@@ -0,0 +1,6 @@
+name: 'Path encoded character test'
+type: module
+description: 'Support module for testing path aliases on a route with encoded characters in the path.'
+package: Testing
+version: VERSION
+core: 8.x
diff --git a/core/modules/system/tests/modules/path_encoded_test/path_encoded_test.routing.yml b/core/modules/system/tests/modules/path_encoded_test/path_encoded_test.routing.yml
new file mode 100644
index 0000000..e89e4f7
--- /dev/null
+++ b/core/modules/system/tests/modules/path_encoded_test/path_encoded_test.routing.yml
@@ -0,0 +1,23 @@
+path_encoded_test.colon:
+  path: '/hi/llamma:party'
+  defaults:
+    _title: 'Colon'
+    _controller: '\Drupal\path_encoded_test\Controller\PathEncodedTestController::simple'
+  requirements:
+    _access: 'TRUE'
+
+path_encoded_test.atsign:
+  path: '/bloggy/@Dries'
+  defaults:
+    _title: 'At sign'
+    _controller: '\Drupal\path_encoded_test\Controller\PathEncodedTestController::simple'
+  requirements:
+    _access: 'TRUE'
+
+path_encoded_test.parens:
+  path: '/cat(box)'
+  defaults:
+    _title: 'At sign'
+    _controller: '\Drupal\path_encoded_test\Controller\PathEncodedTestController::simple'
+  requirements:
+    _access: 'TRUE'
\ No newline at end of file
diff --git a/core/modules/system/tests/modules/path_encoded_test/src/Controller/PathEncodedTestController.php b/core/modules/system/tests/modules/path_encoded_test/src/Controller/PathEncodedTestController.php
new file mode 100644
index 0000000..027c24f
--- /dev/null
+++ b/core/modules/system/tests/modules/path_encoded_test/src/Controller/PathEncodedTestController.php
@@ -0,0 +1,21 @@
+<?php
+
+namespace Drupal\path_encoded_test\Controller;
+
+use Symfony\Component\HttpFoundation\Response;
+
+/**
+ * Returns responses for path_encoded_test routes.
+ */
+class PathEncodedTestController {
+
+  /**
+   * Returns a HTML simple response.
+   *
+   * @return \Symfony\Component\HttpFoundation\Response
+   */
+  public function simple() {
+    return new Response('<html><body>PathEncodedTestController works</body></html>');
+  }
+
+}
diff --git a/core/modules/system/tests/modules/url_alter_test/src/PathProcessorTest.php b/core/modules/system/tests/modules/url_alter_test/src/PathProcessorTest.php
index e6b9fc2..b3ba568 100644
--- a/core/modules/system/tests/modules/url_alter_test/src/PathProcessorTest.php
+++ b/core/modules/system/tests/modules/url_alter_test/src/PathProcessorTest.php
@@ -49,6 +49,11 @@ public function processOutbound($path, &$options = array(), Request $request = N
       }
     }
 
+    // Verify that $options are alterable.
+    if ($path == '/user/login') {
+      $options['query']['foo'] = 'bar';
+    }
+
     // Rewrite forum/ to community/.
     return preg_replace('@^/forum(.*)@', '/community$1', $path);
   }
diff --git a/core/tests/Drupal/FunctionalTests/Routing/PathEncodedTest.php b/core/tests/Drupal/FunctionalTests/Routing/PathEncodedTest.php
new file mode 100644
index 0000000..5326d78
--- /dev/null
+++ b/core/tests/Drupal/FunctionalTests/Routing/PathEncodedTest.php
@@ -0,0 +1,51 @@
+<?php
+
+namespace Drupal\FunctionalTests\Routing;
+
+use Drupal\Core\Url;
+use Drupal\Tests\BrowserTestBase;
+
+/**
+ * Tests url generation and routing for route paths with encoded characters.
+ *
+ * @group routing
+ */
+class PathEncodedTest extends BrowserTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public static $modules = ['system', 'path_encoded_test'];
+
+  public function testGetEncoded() {
+    $route_paths = [
+      'path_encoded_test.colon' => '/hi/llamma:party',
+      'path_encoded_test.atsign' => '/bloggy/@Dries',
+      'path_encoded_test.parens' => '/cat(box)',
+    ];
+    foreach ($route_paths as $route_name => $path) {
+      $this->drupalGet(Url::fromRoute($route_name));
+      $this->assertSession()->pageTextContains('PathEncodedTestController works');
+    }
+  }
+
+  public function testAliasToEncoded() {
+    $route_paths = [
+      'path_encoded_test.colon' => '/hi/llamma:party',
+      'path_encoded_test.atsign' => '/bloggy/@Dries',
+      'path_encoded_test.parens' => '/cat(box)',
+    ];
+    /** @var \Drupal\Core\Path\AliasStorageInterface $alias_storage */
+    $alias_storage = $this->container->get('path.alias_storage');
+    $aliases = [];
+    foreach ($route_paths as $route_name => $path) {
+      $aliases[$route_name] = $this->randomMachineName();
+      $alias_storage->save($path, '/' . $aliases[$route_name]);
+    }
+    foreach ($route_paths as $route_name => $path) {
+      $this->assertRegExp('@/' . rawurlencode($aliases[$route_name]) . '$@', Url::fromRoute($route_name)->toString());
+      $this->drupalGet(Url::fromRoute($route_name));
+      $this->assertSession()->pageTextContains('PathEncodedTestController works');
+    }
+  }
+}
\ No newline at end of file
