Distinguish between ascii and dynamic charsets

add charset class
add ascii charset
add dynamic charset
modify encoding and decoding