Fix shapefile encoding detection