The complete solution without skipping any encoding (even UTF-7 :)