implemented a solution for customize charset encoding