Mar-04-2019, 08:26 AM
If I understood the code right, there happens an implicit encoding to utf8mb4, if no other default encoding has been set.
If I'm right, this means the encoding takes 4 byte for each character. This can be something for internal optimization of MySQL itself.
Where the encoding happens: https://github.com/aio-libs/aiomysql/blo...on.py#L426
If you have a
If your input was made with a koi8-r encoding, somewhere must happen a conversion.
For example if you enter form data on a web page, you should receive the parameters as raw bytes.
Then they need to be decoded, to be represented as
If the query is a
If I'm right, this means the encoding takes 4 byte for each character. This can be something for internal optimization of MySQL itself.
Where the encoding happens: https://github.com/aio-libs/aiomysql/blo...on.py#L426
DEFAULT_CHARSET
from external dependency: https://github.com/PyMySQL/PyMySQL/blob/...ons.py#L91If you have a
str
, it's already encoded internally with utf8.If your input was made with a koi8-r encoding, somewhere must happen a conversion.
For example if you enter form data on a web page, you should receive the parameters as raw bytes.
Then they need to be decoded, to be represented as
str
.If the query is a
str
, then it is automatically encoded to utf8mb4, if no other encoding has been set somewhere.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!