Skip to content
Prev 25884 / 29559 Next

How can I read a path containing multibyte characters using the read_sf () function?

Dears,

How can I read data containing multibyte characters in windows
using the read_sf () function?

library(sf)
nc <- st_read(system.file("shape/nc.shp", package="sf"))
write_sf(nc, dsn=enc2utf8("???"), layer="test", driver="ESRI Shapefile")
dsn = enc2utf8("???/test.shp")
read_sf(dsn)

ERROR:
Cannot open data source C:\Users*****\nc\???
Error in CPL_read_ogr(dsn, layer, as.character(options), quiet, type, :
Open failed.

best,
Ogawa