From b00cc65953b783d76a182d67d59b86a884872dd2 Mon Sep 17 00:00:00 2001 From: Hiroaki Yutani Date: Tue, 1 May 2018 19:49:42 +0900 Subject: [PATCH 1/3] use Rf_translateChar() --- src/Source.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Source.cpp b/src/Source.cpp index f322d47f..bcd8377e 100644 --- a/src/Source.cpp +++ b/src/Source.cpp @@ -18,8 +18,8 @@ SourcePtr Source::create(List spec) { return SourcePtr( new SourceString(as(spec[0]), skip, comment)); } else if (subclass == "source_file") { - std::string path(as(spec[0])[0]); - return SourcePtr(new SourceFile(path, skip, comment)); + SEXP path(as(spec[0])[0]); + return SourcePtr(new SourceFile(Rf_translateChar(path), skip, comment)); } Rcpp::stop("Unknown source type"); From d5e259e06e9bb8d73afba6b0e320627090db71a4 Mon Sep 17 00:00:00 2001 From: Hiroaki Yutani Date: Fri, 11 May 2018 08:03:54 +0900 Subject: [PATCH 2/3] declare path as CharacterVector --- src/Source.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Source.cpp b/src/Source.cpp index bcd8377e..7200f5f5 100644 --- a/src/Source.cpp +++ b/src/Source.cpp @@ -18,8 +18,8 @@ SourcePtr Source::create(List spec) { return SourcePtr( new SourceString(as(spec[0]), skip, comment)); } else if (subclass == "source_file") { - SEXP path(as(spec[0])[0]); - return SourcePtr(new SourceFile(Rf_translateChar(path), skip, comment)); + CharacterVector path(spec[0]); + return SourcePtr(new SourceFile(Rf_translateChar(path[0]), skip, comment)); } Rcpp::stop("Unknown source type"); From 3ec995ed3b62b6a7e2eb1af45f65be68e9bd1112 Mon Sep 17 00:00:00 2001 From: Hiroaki Yutani Date: Fri, 11 May 2018 08:09:10 +0900 Subject: [PATCH 3/3] add a NEWS item --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index cbb43137..90bc3bf9 100644 --- a/NEWS.md +++ b/NEWS.md @@ -51,6 +51,7 @@ you would pass `skip = 3`, now you only need to pass `skip = 2`. in most cases (#730, @yutannihilation). * `read_*()` no longer throws a "length of NULL cannot be changed" warning when trying to resize a skipped column (#750, #833). +* `read_*()` now handles non-ASCII paths properly with R >=3.5.0 on Windows (#838, @yutannihilation). # readr 1.1.1