modified to set default charset.