Wednesday, March 09, 2011

Hebrew (utf8) characters in mysql console over putty

Problem:

I have a mysql server running on a debian linux hosted at linode.com some of my data has hebrew characters (utf8) in it.

I am connecting to the server via putty ssh on windows 7.

But when I run the sql admin console (mysql) and execute a select query all hebrew characters are displayed as '?'.

The data itself wass o.k. (I know this because it is also accessed via a web page where it displays just fine).

Solution:

Step 1. Start mysql with the --defautl-character-set=utf8

If you will now run a query it will properly display the hebrew (and even show it right to left). Only problem is that because of this tables get poorly formated and columns switch places when hebrew is displayed in some of them.

so:

Step 2. Go to the session settings of putty and check "Disable Bidirectional text display" under Terminal-Features.

This will now cause Hebrew to be displayed using Hebrew characters but from left to right. But at least to formatting of the results is readable.

I guess a fix for this could be to render the Unicode Character 'LEFT-TO-RIGHT MARK' (U+200E) before each " |" (Pipe) character that separates column results. I wander if this can be customized...




No comments:

 
Clicky Web Analytics