Skip to content

Instantly share code, notes, and snippets.

@koduki koduki/Nfd2nfc.java
Last active Aug 29, 2015

Embed
What would you like to do?
/*
* 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
You can’t perform that action at this time.