I performed an intersection of two SpatialPolygonsDataFrame on R (3.5.1) using raster::intersect.
Here's the structure of the resulting SPDF attributes table
> str(shp@data)
'data.frame': 944 obs. of 7 variables:
$ COD5 : chr "1122" "1122" "1122" "1122" ...
$ LIV_1 : chr "1" "1" "1" "1" ...
$ LIV_2 : chr "1" "1" "1" "1" ...
$ LIV_3 : chr "2" "2" "2" "2" ...
$ LIV_4 : chr "2" "2" "2" "2" ...
$ LIV_5 : chr NA NA NA NA ...
$ SHAPE_AREA: num 23499 10474 5227 13752 71721 ...
I exported the SPDF with rgdal::writeOGR
writeOGR(shp, 'C:/foo', 'shp', 'ESRI Shapefile', overwrite_layer=T)
but QGIS 3.4 LTR was unable to display attributes correctly
Is it an enconding problem with rgdal::writeOGR? I read the documentation of the function but I didn't figure out how to solve it.
I tried with
writeOGR(shp, 'C:/foo', 'shp', 'ESRI Shapefile', layer_options="ENCODING=UTF-8", overwrite_layer=T)
but the result didn't change. I also tried with the updated rgdal package version (1.4-4).


writeOGR(obj, dsn, layer, driver, dataset_options = NULL, layer_options=NULL, verbose = FALSE, check_exists=NULL, overwrite_layer=FALSE, delete_dsn=FALSE, morphToESRI=NULL, encoding=NULL) see: https://www.rdocumentation.org/packages/rgdal/versions/1.4-4/topics/writeOGR
– vagvaf Aug 07 '19 at 09:08