Skip to content

Unneccessary check for non-ASCII filenames should be removed #272

@toreeriksson

Description

@toreeriksson

Currently, boxr checks for non-ASCII filenames in the function box_filename() implemented in boxr__internal_misc.R, and raises an error if any non-ASCII characters are present. However, the BOX API does not have any such restrictions.

Thus, if lines 7-12 of boxr__internal_misc.R are deleted, the package will work for non-English environments as well. I have tested this locally and was able to upload a file named テストファイル.txt without problems.

diff --git i/R/boxr__internal_misc.R w/R/boxr__internal_misc.R
index 9e50756..2deb343 100644
--- i/R/boxr__internal_misc.R
+++ w/R/boxr__internal_misc.R
@@ -4,12 +4,6 @@
 # supported are those that contain non-printable ascii, / or \, names with
 # trailing spaces, and the special names "." and "..".
 box_filename <- function(x) {
-  x <- iconv(x, from = "", to = "ascii")
-
-  if (is.na(x))
-    stop("box.com accepts only valid ASCII filenames. Filename conversion to",
-         " ASCII via iconv() failed. See ?Encoding")
-
   if (nchar(x) > 255)
     stop("box.com accepts only filenames of 255 characters or less. Filename ",
          "is ", nchar(x), " characters long.")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions