[R-sig-Geo] How can I read a path containing multibyte characters using the read_sf () function?
istazahn at gmail.com
Thu Aug 17 22:10:56 CEST 2017
I can reproduce the error on Windows, though the error message isn't
very useful. The useful part is the part that comes after that, the
part you didn't include in your question:
In addition: Warning message:
In normalizePath(path.expand(path), winslash, mustWork) :
path="<U+30C7><U+30FC><U+30BF>/test.shp": The filename, directory
name, or volume label syntax is incorrect
Taking the extrodanary step of googling for the problem I find a bug
report as the first result in
The upshot from that bug report is that you can either
a) stop using windows (it works on Mac and Linux),
b) use the development version of R where this issue is now fixed on
c) wait for R 3.5 to be released.
With tongue only partially in cheek I suggest that a) is your best option.
On Thu, Aug 17, 2017 at 7:32 AM, 小川福嗣 <fukutugu at yahoo.co.jp> wrote:
> How can I read data containing multibyte characters in windows
> using the read_sf () function?
> nc <- st_read(system.file("shape/nc.shp", package="sf"))
> write_sf(nc, dsn=enc2utf8("データ"), layer="test", driver="ESRI Shapefile")
> dsn = enc2utf8("データ/test.shp")
> Cannot open data source C:\Users*****\nc\データ
> Error in CPL_read_ogr(dsn, layer, as.character(options), quiet, type, :
> Open failed.
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
More information about the R-sig-Geo