fixed routine character encoding