[R] Converting CSV file to UTF-8 encoding

Mehdi Dadkhah mehd|d@dkh@h91 @end|ng |rom gm@||@com
Wed May 6 06:29:15 CEST 2020


Thank you!
it works for me.
With best regards,

On Tue, May 5, 2020 at 3:27 PM Rasmus Liland <jral using posteo.no> wrote:

> On 2020-05-05 15:12 +0430, Mehdi Dadkhah wrote:
> > I have a CSV file which its encoding is
> > ANSI. How can i change its encoding to
> > UTF-8 in R?
>
> Hi!
>
> I do not know about ANSI, but to read latin1
> encoded csv files into readr, do this:
>
> Determine that your file is latin1-encoded:
>
>         rasmus using twentyfive ~ % file -i SAA.csv
>         SAA.csv: application/csv; charset=iso-8859-1
>
> read it in using readr::read_csv
>
>         locale <- readr::locale(encoding = "latin1")
>         SAA <- suppressMessages(
>           readr::read_csv(file="SAA.csv",
>                           locale=locale))
>
> Best,
> Rasmus
>


-- 
*Mehdi Dadkhah*

	[[alternative HTML version deleted]]



More information about the R-help mailing list