Quantcast
Channel: Active questions tagged utf-8 - Stack Overflow
Viewing all articles
Browse latest Browse all 1135

Converting a UTF-8-CSV to UTF-16 (Unicode) in PowerShell

$
0
0

To whom it may concern,

I want to convert my CSV, which is in UTF-8, into UTF-16 using PowerShell. For this task, I wrote the following line of code:

$schuelerCSVUTF8 = Get-Content -Path "C:\tmp\PSProjekt\schueler.csv" | Set-Content -Path "C:\tmp\PSProjekt\lol\schueler.csv" -Encoding Unicode -Force

I see in VS Code that the formatting has correctly changed to UTF-16 LE. But there is a problem.

Some entries get converted correctly:

Before converting, an entry in the CSV looks like this: Z�rcher.

After converting, it looks like this: Zürcher.

But others don't:

Before converting, the entry in the CSV looks like this (already correct): Meriç

After converting, it looks like this (now it's false): Meriç

Does anyone know a solution to that or why that happens?


Viewing all articles
Browse latest Browse all 1135

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>