charset variable renamed to encoding