Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

how to convert back from UTF8 to ISO-8859-1 encoding?

$
0
0

hi,

I have a bunch of XML files which were wrongly encoded, and we lost all our accent characters.

ie: é become é

so how can I recover my XML files using powershell?

so I want to change all the UTF8 ecoded characters back to the original ISO accent character

é -> é

I try this:

1")

$utf8 = [System.text.Encoding]::UTF8
$utfBytes = $utf8.GetBytes("é")
$isoBytes = [System.text.Encoding]::Convert($utf8, $iso, $utfBytes)
$iso.GetString($isoBytes)

but doesnt works.

so is there a way to do this in powershell?

I have to scan hundreds of files...

thanks.


Viewing all articles
Browse latest Browse all 15028

Trending Articles



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