Advertisement
Combreal

DecodeUTF8.ps1

May 12th, 2022 (edited)
1,117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $valuesToDecode = @(
  2.     "éé"
  3. )
  4. Function DecodeStringToAscci($string) {
  5.     If($string -like "*ê*") {
  6.         $string = $string.replace('ê','ê')
  7.     }
  8.     If($string -like "*é*") {
  9.         $string = $string.replace('é','é')
  10.     }
  11.     If($string -like "*è*") {
  12.         $string = $string.replace('è','è')
  13.     }
  14.     If($string -like "*à*") {
  15.         $string = $string.replace('à','à')
  16.     }
  17.     If($string -like "*À*") {
  18.         $string = $string.replace('À','À')
  19.     }
  20.     If($string -like "*Ê*") {
  21.         $string = $string.replace('Ê','Ê')
  22.     }
  23.     If($string -like "*ô*") {
  24.         $string = $string.replace('ô','ô')
  25.     }
  26.     If($string -like "*ù*") {
  27.         $string = $string.replace('ù','ù')
  28.     }
  29.     If($string -like "*ï*") {
  30.         $string = $string.replace('ï','ï')
  31.     }
  32.     If($string -like "*æ*") {
  33.         $string = $string.replace('æ','æ')
  34.     }
  35.     If($string -like "*ç*") {
  36.         $string = $string.replace('ç','ç')
  37.     }
  38.     If($string -like "*Ç*") {
  39.         $string = $string.replace('Ç','Ç')
  40.     }
  41.     return $string
  42. }
  43.  
  44. $valuesToDecode | foreach {
  45.     DecodeStringToAscci $_
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement