fix bug that special characters are not escaped when appear on border