The best thing I can think of is using a sort of Sequence to Sequence Model
The training will be in two parts

Training an encoder to convert strings into their respective encoding
Training a decoder to convert the trained encoders encoding into a string