Convert text encoding and replace charset code