Skip to content

Commit

Permalink
Normalize all paths, prior conversion to native encoding
Browse files Browse the repository at this point in the history
Fixes #498

Prior to b10a1a8,all xls paths were normalized, but we didn't know exactly why. In b10a1a8, I stopped normalizing xls paths, while solving an unrelated path encoding problem presented by R 3.5.

In discussion around #477, @jimhester said:

"I think doing enc2native(normalizePath()) on the R side for both xls and xlsx seems the best option."

I am now taking this wise advice.
  • Loading branch information
jennybc committed Aug 20, 2018
1 parent b1d1959 commit 09e9559
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# readxl 1.1.0.9000
# readxl *development version*

* readxl has a new vignette on reading excel files with multiple header rows, contributed by @apreshill. (#486, #492)

Expand All @@ -12,10 +12,9 @@

## Other changes

* Path handling (#477):
* Path handling:

- `.xls` paths are no longer normalized. (#476 xls)
- All paths are explicitly converted to the native encoding via `enc2native()` (#370)
- All paths are passed through `normalizePath()` (#498, #499, new behaviour for xlsx but not xls) and `enc2native()` (#370).

# readxl 1.1.0

Expand Down
2 changes: 1 addition & 1 deletion R/read_excel.R
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ read_excel_ <- function(path, sheet = NULL, range = NULL,
tibble::set_tidy_names(
tibble::as_tibble(
read_fun(
path = enc2native(path), sheet_i = sheet,
path = enc2native(normalizePath(path)), sheet_i = sheet,
limits = limits, shim = shim,
col_names = col_names, col_types = col_types,
na = na, trim_ws = trim_ws, guess_max = guess_max
Expand Down

0 comments on commit 09e9559

Please sign in to comment.