dleutnant / swmmr

R Interface for US EPA's SWMM
https://cran.r-project.org/package=swmmr
39 stars 15 forks source link

read_rpt() not capable of reading rpt file when exponents are included (i.e. when storage units are included in model) #112

Closed schuetzpaul closed 1 year ago

schuetzpaul commented 1 year ago

swmmr::read_rpt() is not capable of reading/loading the rpt.file when an exponent is included. In my example this is the case when a storage unit is included in the model:

rpt_file <- swmmr::read_rpt("/00_template.rpt")

grafik

In R, the following Error appears:

Error in sub(re, "", x, perl = TRUE) : input string 212 is invalid UTF-8

hsonne commented 1 year ago

If you are on Windows, please try the following workaround. It tells the read_rpt() function how characters are encoded in the file:

rpt_file <- swmmr::read_rpt("/00_template.rpt", locale = readr::locale(encoding = "WINDOWS-1252"))

Does that work for you?

schuetzpaul commented 1 year ago

Yes, works perfectly, thanks!