Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I do a select in MySQL on a column in Terminal on Mac, it appears like this:

+-------------------+
| my_iso8859_column |
+-------------------+
|.. .......         |
| ..... ....        |
| .. .......        |
| ...... ...        |
| ..... ....        |
+-------------------+

(Note: I intentionally replaced the actual content with dots.)

However, if I use SET NAMES UTF8 and then select on a UTF8 column, the right margin characters all appear in the wrong place.

+---------------------+
| my_utf8_column      |
+---------------------+
|.. .......       |
| ..... ....      |
| .. .......       |
| .....               |
| .... ....         |
+---------------------+

How do I fix this?

(Obviously, MySQL incorrectly calculates the length of the string, and therefore the right-aligning becomes incorrect.)

(I don't know if it's a bug in MySQL, a UNIX setting or a Terminal setting. Terminal settings are: "xterm-256color" and "Unicode (UTF-8)".)

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.