Skip to content

Use utf8mb4 instead of utf8 #1147

@yjfvictor

Description

@yjfvictor

pdo_query("set names utf8");

建议改成

pdo_query("set names utf8mb4");

MySQL 的 utf8mb4 才是现行的 UTF-8 标准,而 MySQL 的 utf8 指的是旧版UTF-8标准(utf8mb3)。那个旧标准UTF-8只支持最多三个字节,而不支持四个字节的UTF-8字符,比如越南喃字、部分汉语方言用字和部分emoji等等。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions