Something like Unix pipe would be best, for example, shift_jis -> UTF-8 -> to_lower.
Avoid iconv because of license incompatibility.
Maybe we can use some parts of libnkf, bsdconv, PHP's mbstring.
This is a very important subject, so let's take time for consideration.