References to SQL database solutions for saving special characters
The difference between varchar and nvarchar, and text and ntext?
varchar and text cannot be stored "(? ´ 艸 '?)" This string, added in, eventually becomes "(? 艸 ')"
--The following quoted netizens Baidu know reply
varchar (n)
variable-length, non-Unicode character data with a length of n bytes. n must be a numeric value between 1 and 8,000. Storage size is the actual length of bytes of input data, not n bytes.
nvarchar (n)
a variable-length Unicode character data that contains n characters. The value of n must be between 1 and 4,000. The storage size of bytes is twice times the number of characters entered.
Two fields have field values, respectively: me and coffee .
The varchar field accounts for 2x2+6=10 bytes of storage, while the nvarchar field accounts for 8x2=16 bytes of storage space.
If the field value is only English can choose varchar, and the field value exists more double-byte (Chinese, Korean , etc.) characters with nvarchar
above is a summary of the introduction, through the above introduction, you can know.
varchar (4) You can enter 4 letters or two characters
nvarchar (4) can lose four characters, can also lose 4 letters, but a maximum of four
How special character (Unicode) characters are stored