-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Feature Request
What
I would like to see support for bindings regarding UTF-16 strings in both parameterization for prepared statements and annotations for model columns.
Why
Currently there is no support, in Doctrine, for this kind of thing, and some strings used in applications contain characters used in the UTF-16 realm, such as CJK and emojis.
How
PDO offers a parameter type called \PDO::PARAM_STR_NATL
A const can be added in the \Doctrine\DBAL\ParameterType class called STRING_NATL
This can be mapped to the \PDO::PARAM_STR_NATL value so that it can be available for prepared statements that do not go through raw PDO
A const STRING_NATL would need to be added to the \Doctrine\DBAL\Types\Types class with the value of string_natl. A custom class type, \Doctrine\DBAL\Types\StringNatlType can be created as an extension of the \Doctrine\DBAL\Types\StringType class. This would just need to return \Doctrine\DBAL\Types\Types::STRING_NATL from the getName method and the getBindingType method would just need to return \Doctrine\DBAL\ParameterType::STRING_NATL.