Currently, we use uchardet to detect lyrics encoding. This library is a (not very well maintained) fork of Mozilla's chardet. Alternatives:
The problem with most of the above alternatives is that the web requirements may not be the same as MIDI lyrics.