Skip to content

Instantly share code, notes, and snippets.

@koduki
Last active August 29, 2015 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koduki/d8a42438f7246de01b1e to your computer and use it in GitHub Desktop.
Save koduki/d8a42438f7246de01b1e to your computer and use it in GitHub Desktop.
/*
* 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