Convert a file encoding using R? (ANSI to UTF-8)

前端 未结 2 488
终归单人心
终归单人心 2020-12-16 18:52

I wish to convert an HTML file encoded in ANSI to UTF-8, using R.

Is there a tool, or a combination of tools, that can make this work?

Thanks.

2条回答
  •  失恋的感觉
    2020-12-16 19:35

    I had some problems with the solutions proposed above, especially with the TAB character. This alternative never disappointed me. Unfortunately it only works on UNIX-like systems.

    system('iconv -f CP1252 -t UTF-8 < tmp.html > tmp2.html')
    

提交回复
热议问题