Revised r10338 (fix special chars in image name without utf-8 shop and ajax requests) to use our wrapper function which checks the encoding