diff --git a/includes/form.inc b/includes/form.inc
index df1b2f7..f3bfbe2 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -1951,6 +1951,12 @@ function _form_builder_handle_input_element($form_id, &$element, &$form_state) {
         drupal_array_set_nested_value($form_state['input'], $element['#parents'], NULL);
         $input_exists = TRUE;
       }
+
+      // Check whether the input is valid UTF-8.
+      if ($input_exists && is_string($input) && variable_get('form_filter_utf8', TRUE) && !drupal_validate_utf8($input)) {
+        $input_exists = FALSE;
+      }
+
       // If we have input for the current element, assign it to the #value
       // property, optionally filtered through $value_callback.
       if ($input_exists) {
