1

When making custom field and doing field definitions for string I came upon this setting.

  'type' => $field_definition->getSetting('is_ascii') === TRUE ? 'varchar_ascii' : 'varchar',

I just cant find a reference what would it be if a field definition is set to "varchar_ascii" is it something to do with "Collation" ?

1 Answer 1

4

The doc block of database.api.php/Schema API state:

A special varchar_ascii type is also available for limiting machine name field to US ASCII characters.

You can see its implementation in Schema::createFieldSql() of the MySQL abstraction layer.

So yes, it changes the default UTF-8 character set/collation to ASCII.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.