fix encoding issue of spatial index creation (fix #7794)