Add constructor to specify character encoding