Store ASCII codes in mysql DB database

I need to store character codes in a MySQL ASCII database table, for example this for example (★ ⋰⋱ ★ ⋰⋱ ★ ⋰⋱ ★ ⋰ ⋱ ★)
Do I have to manipulate the data before saving in my db (using javascript) to save as html codes (& heart;) or do I need to change the type of data stored in memory and MySQL will process everything? (UTF-8)

+4
source share
1 answer

If the database field should be encoded in ASCII, I would definitely preserve these esoteric characters, as &heart; , as you said, because ASCII, of course, does not apply to these characters (ASCII uses only 7 bits to store character data).

However, I would recommend using UTF-8 for your database field. UTF-8 allows for a much wider range of characters.

+2
source

Source: https://habr.com/ru/post/1399229/


All Articles