fix unicode error with japanese LANG (fix #578)

@josegaert @nicolasWDC @saljam @wjwwood @yukota This PR supersedes #578.

Please test your use case against this branch of catkin and report if it works for you. If not please provide a detailed description how to reproduce your problem.