Convert UTF-16 to UTF-8 under Windows and Linux, in C

前端 未结 8 722
不思量自难忘°
不思量自难忘° 2020-12-01 02:50

I was wondering if there is a recommended \'cross\' Windows and Linux method for the purpose of converting strings from UTF-16LE to UTF-8? or one should use different method

8条回答
  •  南方客
    南方客 (楼主)
    2020-12-01 03:43

    Change encoding to UTF-8 with PowerShell:

    powershell -Command "Get-Content PATH\temp.txt -Encoding Unicode | Set-Content -Encoding UTF8 PATH2\temp.txt"
    

提交回复
热议问题