diff --git a/core/includes/ajax.inc b/core/includes/ajax.inc
index bb77798..14ecadd 100644
--- a/core/includes/ajax.inc
+++ b/core/includes/ajax.inc
@@ -299,7 +299,7 @@ function ajax_render($commands = array()) {
   // Allow modules to alter any Ajax response.
   drupal_alter('ajax_render', $commands);
 
-  return drupal_json_encode($commands);
+  return json::encode($commands);
 }
 
 /**
diff --git a/core/lib/Drupal/Core/Asset/JsCollectionRenderer.php b/core/lib/Drupal/Core/Asset/JsCollectionRenderer.php
index b9f6582..cb693f2 100644
--- a/core/lib/Drupal/Core/Asset/JsCollectionRenderer.php
+++ b/core/lib/Drupal/Core/Asset/JsCollectionRenderer.php
@@ -54,7 +54,7 @@ public function render(array $js_assets) {
       switch ($js_asset['type']) {
         case 'setting':
           $element['#value_prefix'] = $embed_prefix;
-          $element['#value'] = 'var drupalSettings = ' . drupal_json_encode(drupal_merge_js_settings($js_asset['data'])) . ";";
+          $element['#value'] = 'var drupalSettings = ' . json::encode(drupal_merge_js_settings($js_asset['data'])) . ";";
           $element['#value_suffix'] = $embed_suffix;
           break;
 
diff --git a/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/Editor/CKEditor.php b/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/Editor/CKEditor.php
index 0465cdf..6b71c59 100644
--- a/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/Editor/CKEditor.php
+++ b/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/Editor/CKEditor.php
@@ -135,7 +135,7 @@ public function settingsForm(array $form, array &$form_state, EditorEntity $edit
     $form['toolbar']['buttons'] = array(
       '#type' => 'textarea',
       '#title' => t('Toolbar buttons'),
-      '#default_value' => json_encode($editor->settings['toolbar']['buttons']),
+      '#default_value' => Json::encode($editor->settings['toolbar']['buttons']),
       '#attributes' => array('class' => array('ckeditor-toolbar-textarea')),
     );
 
diff --git a/core/modules/ckeditor/lib/Drupal/ckeditor/Tests/CKEditorAdminTest.php b/core/modules/ckeditor/lib/Drupal/ckeditor/Tests/CKEditorAdminTest.php
index d2e42f9..b58c17d 100644
--- a/core/modules/ckeditor/lib/Drupal/ckeditor/Tests/CKEditorAdminTest.php
+++ b/core/modules/ckeditor/lib/Drupal/ckeditor/Tests/CKEditorAdminTest.php
@@ -98,7 +98,7 @@ function testAdmin() {
 
     // Ensure the toolbar buttons configuration value is initialized to the
     // expected default value.
-    $expected_buttons_value = json_encode($expected_default_settings['toolbar']['buttons']);
+    $expected_buttons_value = Json::encode($expected_default_settings['toolbar']['buttons']);
     $this->assertFieldByName('editor[settings][toolbar][buttons]', $expected_buttons_value);
 
     // Ensure the styles textarea exists and is initialized empty.
@@ -136,7 +136,7 @@ function testAdmin() {
       array('JustifyCenter'),
     );
     $edit = array(
-      'editor[settings][toolbar][buttons]' => json_encode($expected_settings['toolbar']['buttons']),
+      'editor[settings][toolbar][buttons]' => Json::encode($expected_settings['toolbar']['buttons']),
     );
     $this->drupalPostForm(NULL, $edit, t('Save configuration'));
     $editor = entity_load('editor', 'filtered_html');
diff --git a/core/modules/config/lib/Drupal/config/Form/ConfigSync.php b/core/modules/config/lib/Drupal/config/Form/ConfigSync.php
index 7876ef6..4122884 100644
--- a/core/modules/config/lib/Drupal/config/Form/ConfigSync.php
+++ b/core/modules/config/lib/Drupal/config/Form/ConfigSync.php
@@ -177,7 +177,7 @@ public function buildForm(array $form, array &$form_state) {
           'attributes' => array(
             'class' => array('use-ajax'),
             'data-accepts' => 'application/vnd.drupal-modal',
-            'data-dialog-options' => json_encode(array(
+            'data-dialog-options' => Json::encode(array(
               'width' => 700
             )),
           ),
diff --git a/core/modules/contextual/lib/Drupal/contextual/Plugin/views/field/ContextualLinks.php b/core/modules/contextual/lib/Drupal/contextual/Plugin/views/field/ContextualLinks.php
index 30de8f9..59f4811 100644
--- a/core/modules/contextual/lib/Drupal/contextual/Plugin/views/field/ContextualLinks.php
+++ b/core/modules/contextual/lib/Drupal/contextual/Plugin/views/field/ContextualLinks.php
@@ -105,7 +105,7 @@ public function render(ResultRow $values) {
           '',
           array(),
           array(
-            'contextual-views-field-links' => drupal_encode_path(drupal_json_encode($links)),
+            'contextual-views-field-links' => drupal_encode_path(Json::encode($links)),
           )
         )
       );
diff --git a/core/modules/editor/lib/Drupal/editor/Tests/EditIntegrationTest.php b/core/modules/editor/lib/Drupal/editor/Tests/EditIntegrationTest.php
index 6be87d0..68cd220 100644
--- a/core/modules/editor/lib/Drupal/editor/Tests/EditIntegrationTest.php
+++ b/core/modules/editor/lib/Drupal/editor/Tests/EditIntegrationTest.php
@@ -196,6 +196,6 @@ function testGetUntransformedTextCommand() {
         'data' => 'Test',
       )
     );
-    $this->assertEqual(drupal_json_encode($expected), $response->prepare($request)->getContent(), 'The GetUntransformedTextCommand AJAX command works correctly.');
+    $this->assertEqual(Json::encode($expected), $response->prepare($request)->getContent(), 'The GetUntransformedTextCommand AJAX command works correctly.');
   }
 }
diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module
index f426670..92044b7 100644
--- a/core/modules/locale/locale.module
+++ b/core/modules/locale/locale.module
@@ -1355,7 +1355,7 @@ function _locale_rebuild_js($langcode = NULL) {
       $data .= "'pluralFormula': function (\$n) { return Number({$locale_plurals[$language->id]['formula']}); }, ";
     }
 
-    $data .= "'strings': " . drupal_json_encode($translations) . " };";
+    $data .= "'strings': " . Json::encode($translations) . " };";
     $data_hash = Crypt::hashBase64($data);
   }
 
diff --git a/core/modules/system/lib/Drupal/system/Tests/Upgrade/SystemUpgradePathTest.php b/core/modules/system/lib/Drupal/system/Tests/Upgrade/SystemUpgradePathTest.php
index 6b0ad23..40e5ae2 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/SystemUpgradePathTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/SystemUpgradePathTest.php
@@ -175,7 +175,7 @@ public function testVariableUpgrade() {
         $stored = $config->get($name);
         // Make sure we have a string representation to show.
         $stored_txt = !is_string($stored) ? json_encode($stored) : $stored;
-        $value_txt = !is_string($value) ? json_encode($value) : $value;
+        $value_txt = !is_string($value) ? Json::encode($value) : $value;
         $this->assertEqual($value, $stored, format_string('Expected value for %name found: %stored (previously: %value).', array('%name' => $name, '%stored' => $stored_txt, '%value' => $value_txt)));
       }
     }
diff --git a/core/modules/system/tests/modules/ajax_test/ajax_test.module b/core/modules/system/tests/modules/ajax_test/ajax_test.module
index 962b3bb..97ad59c 100644
--- a/core/modules/system/tests/modules/ajax_test/ajax_test.module
+++ b/core/modules/system/tests/modules/ajax_test/ajax_test.module
@@ -136,7 +136,7 @@ function ajax_test_dialog() {
         'attributes' => array(
           'class' => array('use-ajax'),
           'data-accepts' => 'application/vnd.drupal-modal',
-          'data-dialog-options' => json_encode(array(
+          'data-dialog-options' => Json::encode(array(
             'width' => 400,
           ))
         ),
@@ -147,7 +147,7 @@ function ajax_test_dialog() {
         'attributes' => array(
           'class' => array('use-ajax'),
           'data-accepts' => 'application/vnd.drupal-dialog',
-          'data-dialog-options' => json_encode(array(
+          'data-dialog-options' => Json::encode(array(
             'target' => 'ajax-test-dialog-wrapper-1',
             'width' => 800,
           ))
@@ -174,7 +174,7 @@ function ajax_test_dialog() {
         'attributes' => array(
           'class' => array('use-ajax'),
           'data-accepts' => 'application/vnd.drupal-modal',
-          'data-dialog-options' => json_encode(array(
+          'data-dialog-options' => Json::encode(array(
             'width' => 800,
             'height' => 500,
           ))
@@ -186,7 +186,7 @@ function ajax_test_dialog() {
         'attributes' => array(
           'class' => array('use-ajax'),
           'data-accepts' => 'application/vnd.drupal-dialog',
-          'data-dialog-options' => json_encode(array(
+          'data-dialog-options' => Json::encode(array(
             'width' => 800,
           ))
         ),
diff --git a/core/modules/system/tests/modules/form_test/form_test.module b/core/modules/system/tests/modules/form_test/form_test.module
index 5b34e1b..7a7848f 100644
--- a/core/modules/system/tests/modules/form_test/form_test.module
+++ b/core/modules/system/tests/modules/form_test/form_test.module
@@ -1107,7 +1107,7 @@ function form_test_form_state_values_clean_form_submit($form, &$form_state) {
   form_state_values_clean($form_state);
   // This won't have a proper JSON header, but Drupal doesn't check for that
   // anyway so this is fine until it's replaced with a JsonResponse.
-  print drupal_json_encode($form_state['values']);
+  print Json::encode($form_state['values']);
   exit;
 }
 
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTest.php
index c57397b..beb71ad 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTest.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTest.php
@@ -267,7 +267,7 @@ function testTermAutocompletion() {
     $path = 'taxonomy/autocomplete/node/taxonomy_' . $this->vocabulary->id();
     $this->drupalGet($path, array('query' => array('q' => $input)));
     $target = array($first_term->label() => check_plain($first_term->label()));
-    $this->assertRaw(drupal_json_encode($target), 'Autocomplete returns only the expected matching term.');
+    $this->assertRaw(Json::encode($target), 'Autocomplete returns only the expected matching term.');
 
     // Try to autocomplete a term name with both a comma and a slash.
     $input = '"term with, comma and / a';
@@ -279,7 +279,7 @@ function testTermAutocompletion() {
       $n = '"' . str_replace('"', '""', $third_term->label()) . '"';
     }
     $target = array($n => check_plain($third_term->label()));
-    $this->assertRaw(drupal_json_encode($target), 'Autocomplete returns a term containing a comma and a slash.');
+    $this->assertRaw(Json::encode($target), 'Autocomplete returns a term containing a comma and a slash.');
   }
 
   /**
