Message-ID: <CA+vqiLFr-DUgtHR0kvnydkm==iQrgekN-EeK65=-C=WCVQYPuA@mail.gmail.com>
Date: 2017-08-17T20:10:56Z
From: Ista Zahn
Subject: How can I read a path containing multibyte characters using the read_sf () function?
In-Reply-To: <CAJ0_Ro02awgJ+=UnK+aVQvOaV7yDc15Ur9F3T47cV_yh2JdhZQ@mail.gmail.com>
Hi Ogawa,
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[1]="<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
https://www.google.com/search?q=R+normalizePath(path.expand(path)%2C+winslash%2C+mustWork)+utf-8+windows
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
Windows, or
c) wait for R 3.5 to be released.
With tongue only partially in cheek I suggest that a) is your best option.
Best,
Ista
On Thu, Aug 17, 2017 at 7:32 AM, ???? <fukutugu at yahoo.co.jp> wrote:
> 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
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo