encode and decode to ascii