[R] Handle UTF-8 paths on Windows (#9448)

This commit is contained in:
Philip Hyunsu Cho
2023-08-08 21:29:19 -07:00
committed by GitHub
parent c1b2cff874
commit 819098a48f
3 changed files with 23 additions and 2 deletions

View File

@@ -12,7 +12,7 @@ xgb.Booster.handle <- function(params = list(), cachelist = list(),
## A filename
handle <- .Call(XGBoosterCreate_R, cachelist)
modelfile <- path.expand(modelfile)
.Call(XGBoosterLoadModel_R, handle, modelfile[1])
.Call(XGBoosterLoadModel_R, handle, enc2utf8(modelfile[1]))
class(handle) <- "xgb.Booster.handle"
if (length(params) > 0) {
xgb.parameters(handle) <- params