moved charset generation to __init__