moved charset generation back to __init__