String conversion with different charsets