Fix encoding support (#5)