Allow characterset to be specified (bug #1598)