Fix AJAX request to support any of chartype

Such as UTF-8