Skip to content

Commit

Permalink
Encode paths to native encoding #40
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Romain committed May 3, 2019
1 parent 9dc4a74 commit 3883c6b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### rlas v1.3.3

* New: enable to read `.ply` files in `read.las` and `read.lasheader` ([#39](https://github.com/Jean-Romain/rlas/issues/39))
* New: enable to read `.ply` files in `read.las` and `read.lasheader`. This is an undocumented feature not actually intended to be used. ([#39](https://github.com/Jean-Romain/rlas/issues/40)).
* Fix: ([#40](https://github.com/Jean-Romain/rlas/issues/40)) in `read.las` and `read.lasheader` modifications in string encoding in R 3.5.0 generated issues with path containing special characters. Native encoding is now enforced.

### rlas v1.3.2 (Release date: 2019-04-26)

Expand Down
6 changes: 3 additions & 3 deletions R/readLAS.r
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ read.lasheader = function(file)
{
valid <- file.exists(file)
supported <- tools::file_ext(file) %in% c("las", "laz", "LAS", "LAZ", "ply", "PLY")
file <- normalizePath(file)
file <- enc2native(normalizePath(file))

if (!valid) stop("File not found", call. = F)
if (!supported) stop("File not supported", call. = F)
Expand All @@ -102,8 +102,8 @@ read.lasheader = function(file)
stream.las = function(ifiles, ofile = "", select = "*", filter = "", filter_wkt = "")
{
stream <- ofile != ""
ifiles <- normalizePath(ifiles)
ofile <- normalizePath(ofile, mustWork = FALSE)
ifiles <- enc2native(normalizePath(ifiles))
ofile <- enc2native(normalizePath(ofile, mustWork = FALSE))
valid <- file.exists(ifiles)
supported <- tools::file_ext(ifiles) %in% c("las", "laz", "LAS", "LAZ", "ply", "PLY")

Expand Down

0 comments on commit 3883c6b

Please sign in to comment.