How does Vercel Postgres handle Chinese characters in VARCHAR?
Unanswered
Greenish Elaenia posted this in #help-forum
Greenish ElaeniaOP
I created a column of type VARCHAR(255) and expect the user to store chinese characters in this column.
I know that Chinese characters take up more space than english alphabetical characters.
If I store Chinese characters into VARCHAR(255), am I able to store 255 chinese characters max in the column? Or will the data be truncated due to Chinese characters taking up more bytes?
I know that Chinese characters take up more space than english alphabetical characters.
If I store Chinese characters into VARCHAR(255), am I able to store 255 chinese characters max in the column? Or will the data be truncated due to Chinese characters taking up more bytes?
1 Reply
IIRC, varchar(n) would mean you can store n characters and not n bytes.
You should do a quick test to check it out. Also trying to insert something larger than 255 would probably error out rather than truncate.
You should do a quick test to check it out. Also trying to insert something larger than 255 would probably error out rather than truncate.