This is what the MySQL manual says about trailing spaces:
Finishing whitespace is version-dependent. Starting with MySQL 5.0.3, trailing spaces are preserved when values โโare stored and retrieved in accordance with the SQL standard. Prior to MySQL 5.0.3, trailing spaces are removed from values โโwhen they are stored in the VARCHAR column; this means that spaces are also missing from the values โโobtained.
Since your question says that MySQL doesn't repeat trailing spaces, I assume your version is lower than 5.0.3. Consider using a TEXT type for your column; they preserve finite spaces. TEXT will handle string encoding and decoding for you, so you don't need to worry about multibyte characters.
TEXT performs slower than VARBINARY. If the actual data shows that the performance is unacceptable, you may need VARBINARY (or BLOB.) In this case, you need to save the string in a specific encoding, for example UTF-8 . As long as all your clients use the same encoding, this will work fine for multi-byte characters. Test your customers with different regional settings :)
source share