Я пытаюсь учиться symfony и работаю на разных примерах. Основная проблема в том, что я толком не знаю, как настроить doctrine.yaml.
Я использую SQLSRV
Когда я загружаю php bin/console doctrine:fixtures:load --append
появляется ошибка:
SQLSTATE [IMSSP, -48]: The encoding 'utf8' is not a supported encoding for the CharacterSet connection option.
моя конфигурация доктрины:
doctrine:
dbal:
# configure these for your database server
driver: 'pdo_sqlsrv'
charset: utf8
default_table_options:
charset: utf8
collate: utf8_general_ci
url: '%env(resolve:DATABASE_URL)%'
orm:
auto_generate_proxy_classes: true
naming_strategy: doctrine.orm.naming_strategy.underscore
auto_mapping: true
mappings:
App:
is_bundle: false
type: annotation
dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity'
alias: App
также я попробовал конфигурацию по умолчанию:
charset: utf8mb4
default_table_options:
charset: utf8mb4
collate: utf8mb4_unicode_ci






Набор символов utf8 не существует, но UTF-8 (все заглавные буквы) существует. Согласно Microsoft Документация PDO_SQLSRV:
To send or retrieve UTF-8 encoded data to the server:
Make sure that the source or destination column is of type nchar or nvarchar.
Specify the PHP type as SQLSRV_PHPTYPE_STRING('UTF-8') in the parameters array. Or, specify "CharacterSet" => "UTF-8" as a connection option.
When you specify a character set as part of the connection options, the driver assumes that the other connection option strings use that same character set. The server name and query strings are also assumed to use the same character set.
You can pass UTF-8 or SQLSRV_ENC_CHAR to CharacterSet, but you cannot pass SQLSRV_ENC_BINARY. The default encoding is SQLSRV_ENC_CHAR.
Вместо этого вы можете попробовать следующее:
doctrine:
dbal:
# configure these for your database server
driver: 'pdo_sqlsrv'
charset: UTF-8
url: '%env(resolve:DATABASE_URL)%'