Skip to content

Commit

Permalink
Merge pull request #74 from clhunsen/claus-updates
Browse files Browse the repository at this point in the history
Fix file encoding for reading data files

Reviewed-by: Thomas Bock <[email protected]>
  • Loading branch information
bockthom authored Dec 7, 2017
2 parents d156eaf + b05a47a commit bb3d271
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion util-conf.R
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ ProjectConf = R6::R6Class("ProjectConf", inherit = Conf,
## read revisions file
revisions.file = file.path(conf$datapath, "revisions.list")
revisions.df <- try(read.table(revisions.file, header = FALSE, sep = ";", strip.white = TRUE,
fileEncoding = "latin1", encoding = "utf8"), silent = TRUE)
encoding = "UTF-8"), silent = TRUE)
## break if the list of revisions is empty or any other error occurs
if (inherits(revisions.df, 'try-error')) {
logging::logerror("There are no revisions available for the current casestudy.")
Expand Down
8 changes: 4 additions & 4 deletions util-read.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ read.commits.raw = function(data.path, artifact) {

## read data.frame from disk (as expected from save.list.to.file) [can be empty]
commit.data <- try(read.table(file, header = FALSE, sep = ";", strip.white = TRUE,
fileEncoding = "latin1", encoding = "utf8"), silent = TRUE)
encoding = "UTF-8"), silent = TRUE)

## handle the case that the list of commits is empty
if (inherits(commit.data, 'try-error')) {
Expand Down Expand Up @@ -156,7 +156,7 @@ read.mails = function(data.path) {

## read data.frame from disk (as expected from save.list.to.file) [can be empty]
mail.data <- try(read.table(file, header = FALSE, sep = ";", strip.white = TRUE,
fileEncoding = "latin1", encoding = "utf8"), silent = TRUE)
encoding = "UTF-8"), silent = TRUE)

## handle the case that the list of mails is empty
if (inherits(mail.data, 'try-error')) {
Expand Down Expand Up @@ -220,7 +220,7 @@ read.authors = function(data.path) {

## read data.frame from disk (as expected from save.list.to.file) [can be empty]
authors.df <- try(read.table(file, header = FALSE, sep = ";", strip.white = TRUE,
fileEncoding = "latin1", encoding = "utf8"), silent = TRUE)
encoding = "UTF-8"), silent = TRUE)

## break if the list of authors is empty
if (inherits(authors.df, 'try-error')) {
Expand Down Expand Up @@ -319,7 +319,7 @@ read.issues = function(data.path) {

## read issues from disk [can be empty]
issue.data = try(read.table(filepath, header = FALSE, sep = ";", strip.white = TRUE,
fileEncoding = "latin1", encoding = "utf8"), silent = TRUE)
encoding = "UTF-8"), silent = TRUE)

## handle the case that the list of commits is empty
if (inherits(issue.data, 'try-error')) {
Expand Down

0 comments on commit bb3d271

Please sign in to comment.