Bug fixes: charset encoding/decoding