make filename encoding consistent (gdal/ogr)

There are some filename encoding problems. For example, with the Terrain Analysis plugin, the output filename is garbled if the filename includes non-ascii characters. This patch fixes the problems.