diff --git a/core/includes/theme.maintenance.inc b/core/includes/theme.maintenance.inc
index 16779af..7707ca4 100644
--- a/core/includes/theme.maintenance.inc
+++ b/core/includes/theme.maintenance.inc
@@ -29,7 +29,8 @@ function _drupal_maintenance_theme() {
   require_once __DIR__ . '/file.inc';
   require_once __DIR__ . '/module.inc';
   require_once __DIR__ . '/database.inc';
-  Unicode::check();
+  $unicode = new Unicode();
+  $unicode->check();
 
   // Install and update pages are treated differently to prevent theming overrides.
   if (defined('MAINTENANCE_MODE') && (MAINTENANCE_MODE == 'install' || MAINTENANCE_MODE == 'update')) {
diff --git a/core/includes/unicode.inc b/core/includes/unicode.inc
index 56ffd76..fe260ae 100644
--- a/core/includes/unicode.inc
+++ b/core/includes/unicode.inc
@@ -21,7 +21,8 @@ function unicode_requirements() {
     Unicode::STATUS_MULTIBYTE => NULL,
     Unicode::STATUS_ERROR => REQUIREMENT_ERROR,
   );
-  $failed_check = Unicode::check();
+  $unicode = new Unicode();
+  $failed_check = $unicode->check();
   $library = Unicode::getStatus();
 
   $requirements['unicode'] = array(
diff --git a/core/lib/Drupal/Component/Utility/Unicode.php b/core/lib/Drupal/Component/Utility/Unicode.php
index 75ffa1b..af7e2c0 100644
--- a/core/lib/Drupal/Component/Utility/Unicode.php
+++ b/core/lib/Drupal/Component/Utility/Unicode.php
@@ -141,13 +141,14 @@ public static function setStatus($status) {
    *
    * Because of the need to be able to handle text in various encodings, we do
    * not support mbstring function overloading. HTTP input/output conversion
-   * must be disabled for similar reasons.
+   * must be disabled for similar reasons. Additionally, we check that encoding-
+   * related parameters are correctly set for PHP versions 5.6 and up.
    *
    * @return string
    *   A string identifier of a failed multibyte extension check, if any.
    *   Otherwise, an empty string.
    */
-  public static function check() {
+  public function check() {
     // Check for mbstring extension.
     if (!function_exists('mb_strlen')) {
       static::$status = static::STATUS_SINGLEBYTE;
@@ -155,26 +156,58 @@ public static function check() {
     }
 
     // Check mbstring configuration.
-    if (ini_get('mbstring.func_overload') != 0) {
+    if ($this->iniGet('mbstring.func_overload') != 0) {
       static::$status = static::STATUS_ERROR;
       return 'mbstring.func_overload';
     }
-    if (ini_get('mbstring.encoding_translation') != 0) {
+    if ($this->iniGet('mbstring.encoding_translation') != 0) {
       static::$status = static::STATUS_ERROR;
       return 'mbstring.encoding_translation';
     }
     // mbstring.http_input and mbstring.http_output are deprecated and empty by
     // default in PHP 5.6.
-    if (version_compare(PHP_VERSION, '5.6.0') == -1) {
-      if (ini_get('mbstring.http_input') != 'pass') {
+    if (version_compare($this->getPhpVersion(), '5.6.0') == -1) {
+      if ($this->iniGet('mbstring.http_input') != 'pass') {
         static::$status = static::STATUS_ERROR;
         return 'mbstring.http_input';
       }
-      if (ini_get('mbstring.http_output') != 'pass') {
+      if ($this->iniGet('mbstring.http_output') != 'pass') {
         static::$status = static::STATUS_ERROR;
         return 'mbstring.http_output';
       }
     }
+    if (version_compare($this->getPhpVersion(), '5.6.0') >= 0) {
+      // Check encoding settings for PHP versions 5.6 and up.
+      $php_encoding_settings = array(
+        'php.internal_encoding',
+        'php.input_encoding',
+        'php.output_encoding',
+      );
+      foreach ($php_encoding_settings as $php_encoding_setting) {
+        if (strtolower($this->iniGet($php_encoding_setting)) != 'utf-8') {
+          static::$status = static::STATUS_ERROR;
+          return $php_encoding_setting;
+        }
+      }
+
+      $deprecated_encoding_settings = array(
+        'iconv.internal_encoding',
+        'iconv.input_encoding',
+        'iconv.output_encoding',
+        'mbstring.internal_encoding',
+        'mbstring.http_input',
+        'mbstring.http_output',
+      );
+      foreach ($deprecated_encoding_settings as $deprecated_encoding_setting) {
+        // Deprecated parameters must be either not set, or set to UTF-8.
+        if ($this->iniGet($deprecated_encoding_setting) !== FALSE && strtolower($this->iniGet($deprecated_encoding_setting)) != 'utf-8') {
+          if (!(in_array($deprecated_encoding_setting, array('mbstring.http_input', 'mbstring.http_output')) && $this->iniGet($deprecated_encoding_setting) == 'pass')) {
+            static::$status = static::STATUS_ERROR;
+            return $deprecated_encoding_setting;
+          }
+        }
+      }
+    }
 
     // Set appropriate configuration.
     mb_internal_encoding('utf-8');
@@ -184,6 +217,23 @@ public static function check() {
   }
 
   /**
+   * Wrapper for the constant with the current PHP version.
+   *
+   * @return string
+   *   The current PHP version.
+   */
+  protected function getPhpVersion() {
+    return PHP_VERSION;
+  }
+
+  /**
+   * Wrapper for ini_get().
+   */
+  protected function iniGet($variable) {
+    return ini_get($variable);
+  }
+
+  /**
    * Converts data to UTF-8.
    *
    * Requires the iconv, GNU recode or mbstring PHP extension.
diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php
index be9821d..afff7d6 100644
--- a/core/lib/Drupal/Core/DrupalKernel.php
+++ b/core/lib/Drupal/Core/DrupalKernel.php
@@ -785,7 +785,8 @@ public static function bootEnvironment() {
     setlocale(LC_ALL, 'C');
 
     // Detect string handling method.
-    Unicode::check();
+    $unicode = new Unicode();
+    $unicode->check();
 
     // Indicate that code is operating in a test child site.
     if (!defined('DRUPAL_TEST_IN_CHILD_SITE')) {
diff --git a/core/tests/Drupal/Tests/Component/Utility/UnicodeTest.php b/core/tests/Drupal/Tests/Component/Utility/UnicodeTest.php
index 724d875..08fd70b 100644
--- a/core/tests/Drupal/Tests/Component/Utility/UnicodeTest.php
+++ b/core/tests/Drupal/Tests/Component/Utility/UnicodeTest.php
@@ -20,13 +20,141 @@
 class UnicodeTest extends UnitTestCase {
 
   /**
+   * Holds the current php.ini variable to be overriden.
+   *
+   * @var array
+   *   Array with keys:
+   *   - variable_name
+   *   - variable_value
+   */
+  protected $current_ini_variable = array();
+
+  /**
    * {@inheritdoc}
    *
    * @covers ::check
    */
   public function setUp() {
     // Initialize unicode component.
-    Unicode::check();
+    $unicode = new Unicode();
+    $unicode->check();
+  }
+
+  /**
+   * Unit test for the check() method.
+   *
+   * @param string $fake_php_version
+   *   The PHP version to fake.
+   * @param string $variable_name
+   *   The name of the php.ini variable to set.
+   * @param string|bool $new_value
+   *   The new value of the php.ini value to set.
+   * @param bool $passes_check
+   *   Whether the test passes (TRUE) or not (FALSE).
+   *
+   * @dataProvider providerCheck
+   * @covers ::check
+   */
+  public function testCheck($fake_php_version, $variable_name, $new_value, $passes_check) {
+    // Set up a mock object.
+    $mock = $this->getMockBuilder('\Drupal\Component\Utility\Unicode')
+      ->setMethods(array('getPhpVersion', 'iniGet'))
+      ->getMock();
+
+    // Set up a stub for getPhpVersion() that returns the version from the
+    // data provider.
+    $mock->Expects($this->any())
+      ->method('getPhpVersion')
+      ->will($this->returnValue($fake_php_version));
+    // Set up a stub for iniGet() that will return the version from the
+    // data provider for $variable_name, and the actual version
+    // for other variables.
+    $mock->Expects($this->any())
+        ->method('iniGet')
+        ->will($this->returnCallback(array($this, 'iniGetCallback')));
+
+    // Save the current variable into a property so we can access it
+    // in iniGetCallback().
+    $this->current_ini_variable = array(
+      'variable_name' => $variable_name,
+      'variable_value' => $new_value,
+    );
+
+    $check = $mock->check();
+
+    if ($passes_check) {
+      // Make sure the check() method returns NULL if successful.
+      $this->assertEquals($check, NULL);
+    }
+    else {
+      // Make sure the check() method returns the variable name if
+      // not successful.
+      $this->assertEquals($check, $variable_name);
+    }
+
+  }
+
+  /**
+   * Stub for the iniGet() method on the Unicode object.
+   */
+  public function iniGetCallback() {
+    $variable_name = func_get_args()[0];
+
+    if ($variable_name == $this->current_ini_variable['variable_name']) {
+      // Override the "current" variable that we are testing only.
+      return $this->current_ini_variable['variable_value'];
+    }
+    else {
+      // Return a value that should pass tests.
+      $map = array(
+        'mbstring.func_overload' => 0,
+        'mbstring.encoding_translation' => 0,
+        'mbstring.http_input' => 'pass',
+        'mbstring.http_output' => 'pass',
+        'php.internal_encoding' => 'utf-8',
+        'php.input_encoding' => 'utf-8',
+        'php.output_encoding' => 'utf-8',
+        'iconv.output_encoding' => FALSE,
+        'iconv.internal_encoding' => FALSE,
+        'iconv.input_encoding' => FALSE,
+        'mbstring.internal_encoding' => FALSE,
+      );
+      return $map[$variable_name];
+    }
+  }
+
+  /**
+   * Data provider for testCheck().
+   *
+   * @see testCheck()
+   */
+  public function providerCheck() {
+    return [
+      [ '5.6.0', 'mbstring.func_overload', '0', TRUE ],
+      [ '5.6.0', 'mbstring.func_overload', '1', FALSE ],
+      [ '5.6.0', 'mbstring.encoding_translation', '0', TRUE ],
+      [ '5.6.0', 'mbstring.encoding_translation', '1', FALSE ],
+      [ '5.4.0', 'mbstring.http_input', 'pass', TRUE ],
+      [ '5.4.0', 'mbstring.http_input', 'iso-8859-1', FALSE ],
+      [ '5.4.0', 'mbstring.http_output', 'pass', TRUE ],
+      [ '5.4.0', 'mbstring.http_output', 'iso-8859-1', FALSE ],
+      [ '5.6.0', 'mbstring.http_input', 'pass', TRUE ],
+      [ '5.6.0', 'mbstring.http_input', 'utf-8', TRUE ],
+      [ '5.6.0', 'mbstring.http_input', 'iso-8859-1', FALSE ],
+      [ '5.6.0', 'mbstring.http_output', 'pass', TRUE ],
+      [ '5.6.0', 'mbstring.http_output', 'utf-8', TRUE ],
+      [ '5.6.0', 'mbstring.http_output', 'iso-8859-1', FALSE ],
+      [ '5.6.0', 'php.input_encoding', 'UTF-8', TRUE ],
+      [ '5.6.0', 'php.input_encoding', 'iso-8859-1', FALSE ],
+      [ '5.6.0', 'php.output_encoding', 'UTF-8', TRUE ],
+      [ '5.6.0', 'php.output_encoding', 'iso-8859-1', FALSE ],
+      [ '5.6.0', 'php.internal_encoding', 'utf-8', TRUE ],
+      [ '5.6.0', 'php.internal_encoding', 'iso-8859-1', FALSE ],
+      [ '5.6.0', 'iconv.internal_encoding', 'utf-8', TRUE ],
+      [ '5.6.0', 'iconv.internal_encoding', 'iso-8859-1', FALSE ],
+      [ '5.6.0', 'mbstring.internal_encoding', 'utf-8', TRUE ],
+      [ '5.6.0', 'mbstring.internal_encoding', 'iso-8859-1', FALSE ],
+    ];
   }
 
   /**
