fix problem charter encode