simplify `lang2char` code