improve unicode logic