diff --git a/core/modules/file/file.field.inc b/core/modules/file/file.field.inc
index 3252cec..11cfec5 100644
--- a/core/modules/file/file.field.inc
+++ b/core/modules/file/file.field.inc
@@ -6,6 +6,7 @@
  */
 
 use Drupal\field\FieldInterface;
+use Drupal\component\Utility\String;
 
 /**
  * Implements hook_field_info_alter().
@@ -196,7 +197,7 @@ function theme_file_upload_help($variables) {
     $descriptions[] = t('!size limit.', array('!size' => format_size($upload_validators['file_validate_size'][0])));
   }
   if (isset($upload_validators['file_validate_extensions'])) {
-    $descriptions[] = t('Allowed types: !extensions.', array('!extensions' => check_plain($upload_validators['file_validate_extensions'][0])));
+    $descriptions[] = t('Allowed types: !extensions.', array('!extensions' => String::checkPlain($upload_validators['file_validate_extensions'][0])));
   }
 
   if (isset($upload_validators['file_validate_image_resolution'])) {
diff --git a/core/modules/file/file.module b/core/modules/file/file.module
index b359976..7946a43e 100644
--- a/core/modules/file/file.module
+++ b/core/modules/file/file.module
@@ -8,6 +8,7 @@
 use Drupal\file\Entity\File;
 use Drupal\Component\Utility\NestedArray;
 use Drupal\Component\Utility\Unicode;
+use Drupal\Component\Utility\String;
 use Drupal\Core\Entity\EntityStorageControllerInterface;
 use Drupal\Core\Template\Attribute;
 use Drupal\file\FileUsage\FileUsageInterface;
@@ -1018,15 +1019,15 @@ function file_tokens($type, $tokens, array $data = array(), array $options = arr
 
         // Essential file data
         case 'name':
-          $replacements[$original] = $sanitize ? check_plain($file->getFilename()) : $file->getFilename();
+          $replacements[$original] = $sanitize ? String::checkPlain($file->getFilename()) : $file->getFilename();
           break;
 
         case 'path':
-          $replacements[$original] = $sanitize ? check_plain($file->getFileUri()) : $file->getFileUri();
+          $replacements[$original] = $sanitize ? String::checkPlain($file->getFileUri()) : $file->getFileUri();
           break;
 
         case 'mime':
-          $replacements[$original] = $sanitize ? check_plain($file->getMimeType()) : $file->getMimeType();
+          $replacements[$original] = $sanitize ? String::checkPlain($file->getMimeType()) : $file->getMimeType();
           break;
 
         case 'size':
@@ -1034,7 +1035,7 @@ function file_tokens($type, $tokens, array $data = array(), array $options = arr
           break;
 
         case 'url':
-          $replacements[$original] = $sanitize ? check_plain(file_create_url($file->getFileUri())) : file_create_url($file->getFileUri());
+          $replacements[$original] = $sanitize ? String::checkPlain(file_create_url($file->getFileUri())) : file_create_url($file->getFileUri());
           break;
 
         // These tokens are default variations on the chained tokens handled below.
@@ -1048,7 +1049,7 @@ function file_tokens($type, $tokens, array $data = array(), array $options = arr
 
         case 'owner':
           $name = $file->getOwner()->label();
-          $replacements[$original] = $sanitize ? check_plain($name) : $name;
+          $replacements[$original] = $sanitize ? String::checkPlain($name) : $name;
           break;
       }
     }
@@ -1596,7 +1597,7 @@ function theme_file_link($variables) {
   }
   else {
     $link_text = $variables['description'];
-    $options['attributes']['title'] = check_plain($file->getFilename());
+    $options['attributes']['title'] = String::checkPlain($file->getFilename());
   }
 
   $file_icon = array(
@@ -1624,7 +1625,7 @@ function theme_file_icon($variables) {
   $file = $variables['file'];
   $icon_directory = $variables['icon_directory'];
 
-  $mime = check_plain($file->getMimeType());
+  $mime = String::checkPlain($file->getMimeType());
   $icon_url = file_icon_url($file, $icon_directory);
   return '<img class="file-icon" alt="" title="' . $mime . '" src="' . $icon_url . '" />';
 }
diff --git a/core/modules/file/lib/Drupal/file/Plugin/Field/FieldWidget/FileWidget.php b/core/modules/file/lib/Drupal/file/Plugin/Field/FieldWidget/FileWidget.php
index 5c976ed..83d8c33 100644
--- a/core/modules/file/lib/Drupal/file/Plugin/Field/FieldWidget/FileWidget.php
+++ b/core/modules/file/lib/Drupal/file/Plugin/Field/FieldWidget/FileWidget.php
@@ -11,6 +11,7 @@
 use Drupal\Core\Field\WidgetBase;
 use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Component\Utility\NestedArray;
+use Drupal\Component\Utility\String;
 use Drupal\field\Field;
 
 /**
@@ -88,7 +89,7 @@ protected function formMultipleElements(FieldItemListInterface $items, array &$f
         break;
     }
 
-    $title = check_plain($this->fieldDefinition->getLabel());
+    $title = String::checkPlain($this->fieldDefinition->getLabel());
     $description = field_filter_xss($this->fieldDefinition->getDescription());
 
     $elements = array();
diff --git a/core/modules/file/lib/Drupal/file/Tests/FileTokenReplaceTest.php b/core/modules/file/lib/Drupal/file/Tests/FileTokenReplaceTest.php
index 03aedcb..837f097 100644
--- a/core/modules/file/lib/Drupal/file/Tests/FileTokenReplaceTest.php
+++ b/core/modules/file/lib/Drupal/file/Tests/FileTokenReplaceTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\file\Tests;
 
 use Drupal\Core\Language\Language;
+use Drupal\Component\Utility\String;
 
 /**
  * Tests the file token replacement in strings.
@@ -35,7 +36,7 @@ function testFileTokenReplacement() {
 
     $test_file = $this->getTestFile('text');
     // Coping a file to test uploads with non-latin filenames.
-    $filename = drupal_dirname($test_file->getFileUri()) . '/текстовый файл.txt';
+    $filename = drupal_dirname($test_file->getFileUri()) . '/Ñ‚ÐµÐºÑ�Ñ‚Ð¾Ð²Ñ‹Ð¹ Ñ„Ð°Ð¹Ð».txt';
     $test_file = file_copy($test_file, $filename);
 
     // Create a new node with the uploaded file.
@@ -48,16 +49,16 @@ function testFileTokenReplacement() {
     // Generate and test sanitized tokens.
     $tests = array();
     $tests['[file:fid]'] = $file->id();
-    $tests['[file:name]'] = check_plain($file->getFilename());
-    $tests['[file:path]'] = check_plain($file->getFileUri());
-    $tests['[file:mime]'] = check_plain($file->getMimeType());
+    $tests['[file:name]'] = String::checkPlain($file->getFilename());
+    $tests['[file:path]'] = String::checkPlain($file->getFileUri());
+    $tests['[file:mime]'] = String::checkPlain($file->getMimeType());
     $tests['[file:size]'] = format_size($file->getSize());
-    $tests['[file:url]'] = check_plain(file_create_url($file->getFileUri()));
+    $tests['[file:url]'] = String::checkPlain(file_create_url($file->getFileUri()));
     $tests['[file:created]'] = format_date($file->getCreatedTime(), 'medium', '', NULL, $language_interface->id);
     $tests['[file:created:short]'] = format_date($file->getCreatedTime(), 'short', '', NULL, $language_interface->id);
     $tests['[file:changed]'] = format_date($file->getChangedTime(), 'medium', '', NULL, $language_interface->id);
     $tests['[file:changed:short]'] = format_date($file->getChangedTime(), 'short', '', NULL, $language_interface->id);
-    $tests['[file:owner]'] = check_plain(user_format_name($this->admin_user));
+    $tests['[file:owner]'] = String::checkPlain(user_format_name($this->admin_user));
     $tests['[file:owner:uid]'] = $file->getOwnerId();
 
     // Test to make sure that we generated something for each token.
