Hmm, but even without such a conversion in PI, it should still be less effort to do the replacement already in PI? (After all: things like this should be what PI and its mapping engine are there for...)
If all else fails, one could simply create a little Hashmap and fill it with the "pairs" that can occur in your scenario (will at most be 256... ), and then in a mapping at runtime lookup the current value from the Hashmap?!
Best Regards, Ulrich