[ 
https://issues.apache.org/jira/browse/ARROW-9186?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17461670#comment-17461670
 ] 

Dewey Dunnington commented on ARROW-9186:
-----------------------------------------

Reprex:

{code:R}
library(arrow, warn.conflicts = FALSE)

string <- "province_name\nQuébec"
bytes_utf8 <- iconv(string, to = "UTF-8", toRaw = TRUE)[[1]]
bytes_windows1252 <- iconv(string, to = "windows-1252", toRaw = TRUE)[[1]]

temp_utf8 <- tempfile()
temp_windows1252 <- tempfile()

con <- file(temp_utf8, open = "wb")
writeBin(bytes_utf8, con)
close(con)

con <- file(temp_windows1252, open = "wb")
writeBin(bytes_windows1252, con)
close(con)

readr::read_csv(
  temp_utf8,
  locale = readr::locale(encoding = "UTF-8"),
  show_col_types = FALSE
)
#> # A tibble: 1 × 1
#>   province_name
#>   <chr>        
#> 1 Québec

readr::read_csv(
  temp_windows1252,
  locale = readr::locale(encoding = "windows-1252"),
  show_col_types = FALSE
)
#> # A tibble: 1 × 1
#>   province_name
#>   <chr>        
#> 1 Québec

read_csv_arrow(temp_utf8)
#> # A tibble: 1 × 1
#>   province_name
#>   <chr>        
#> 1 Québec
read_csv_arrow(temp_windows1252)
#> # A tibble: 1 × 1
#>            province_name
#>               <arrw_bnr>
#> 1 51, 75, e9, 62, 65, 63
{code}


> [R] Allow specifying CSV file encoding
> --------------------------------------
>
>                 Key: ARROW-9186
>                 URL: https://issues.apache.org/jira/browse/ARROW-9186
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: R
>            Reporter: Neal Richardson
>            Priority: Major
>             Fix For: 7.0.0
>
>
> ARROW-9106 did this for Python and we should have the same in R



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to