Fix problems with character encoding - refs BT#8490