OgrProvider: initial encoding setting check (fix #8167)

This fixes http://hub.qgis.org/issues/8167