Skip to content

Commit 6f4d90f

Browse files
committed
Use translateChar() for native encoding string
CHAR() could in theory return Latin-1 or UTF-8 text. translateChar() checks the encoding bits and only converts if needed, releasing the memory upon return from the .Call().
1 parent 236bc5c commit 6f4d90f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/freadR.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ SEXP spillConnectionToFile(SEXP connection, SEXP tempfile_path, SEXP nrows_limit
825825

826826
SpillState state = {
827827
.con = R_GetConnection(connection),
828-
.filepath = CHAR(STRING_ELT(tempfile_path, 0)),
828+
.filepath = translateChar(STRING_ELT(tempfile_path, 0)),
829829
.row_limit = 0,
830830
.outfile = NULL,
831831
.buffer = NULL

0 commit comments

Comments
 (0)