1
4

2 に答える 2

4

In PowerShell:

Get-ChildItem | ForEach-Object {
  $filename = Split-Path -Leaf $_
  $new = [Text.Encoding]::Utf8.GetString([Text.Encoding]::Default.GetBytes($filename))
  if ($_.Name -ne $new) {
    Rename-Item $_ $new
  }
}

might work. The whole Rename-Item call could maybe be done easier, but I usually run into trouble when not using the full path so I err on the side of caution.

于 2012-08-23T20:38:13.260 に答える
0

With php:

foreach (glob("*.*") as $filename) {
    rename( $filename, mb_convert_encoding( $filename, "Windows-1252", "UTF-8") );
}
于 2012-08-23T19:03:16.130 に答える