I'm looking for a simple and efficient way to store UTF-8 strings in ASCII-7. With efficient I mean the following:
- all ASCII alphanumeric chars in the input should stay the same ASCII alphanumeric chars in the output
- the resulting string should be as short as possible
- the operation needs to be reversable without any data loss
- the resulting ASCII string should be case insensitive
- there should be no restriction on the input length
- the whole UTF-8 range should be allowed
My first idea was to use Punycode (IDNA) as it fits the first four requirements, but it fails at the last two.
Can anyone recommend an alternative encoding scheme? Even better if there's some code available to look at.