Last active
August 29, 2015 14:15
-
-
Save koduki/d8a42438f7246de01b1e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* To change this license header, choose License Headers in Project Properties. | |
* To change this template file, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
package sandbox; | |
import java.io.File; | |
import java.text.Normalizer; | |
/** | |
* | |
* @author koduki | |
*/ | |
public class Nfd2nfc { | |
static void parse(File root) { | |
for (File f : root.listFiles()) { | |
String name = f.toString(); | |
String nfcName = Normalizer.normalize(name, Normalizer.Form.NFC); | |
if (f.isDirectory()) { | |
parse(f); | |
} | |
if(!name.equals(nfcName)){ | |
System.out.println("rename from " + name + " to " + nfcName); | |
f.renameTo(new File(nfcName)); | |
} | |
} | |
} | |
public static void main(String[] args) { | |
parse(new File(".")); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment