fixed problems with char encoding