Skip to content
Snippets Groups Projects

Enforce ASCII character encoding on string items

1 file
+ 3
0
Compare changes
  • Side-by-side
  • Inline
@@ -67,6 +67,9 @@ public function getConstraints() {
'@max' => $max_length,
]);
}
if ($this->getFieldDefinition()->getSetting('is_ascii') === TRUE) {
$options['charset'] = 'ASCII';
}
$constraints[] = $constraint_manager->create('ComplexData', [
'value' => [
'Length' => $options,
Loading