php - After json_encode, the Chinese characters saved in the database become unicode. How is the length calculated?
某草草
某草草 2017-05-16 13:08:03
0
2
506

I found that after json_encode, the Chinese characters in the array were saved in the database and became unicode.
For example: "I am Chinese",
becomes:

\u6211\u662f\u4e2a\u4e2d\u6587

Originally, "I am Chinese" had a total of 10 characters. After
becomes unicode, does only have a total of 30 characters? ? ?

The text length is 65535. If Chinese characters can be saved directly, there will probably be more than 30,000 Chinese characters.
If it becomes unicode, wouldn’t there only be about 6,500 Chinese characters that can be saved?

If the text length is not enough, change it to mediumtext. Will the database become larger and slower?

There are 3 questions in total, please ask. Sorry for the newbies.

某草草
某草草

reply all(2)
Ty80

Performance will definitely be affected. All usual storage of such large text would create a separate table.

巴扎黑

YesJSON_UNESCAPED_UNICODE, save Chinese directly without escaping.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template