I'm having a heck of a time trying to figure out how to use the Java interop in Clojure to normalize Unicode. I've been trying to to use java.text.Normalizer, but I keep getting ClassNotFoundException
when trying to call the enum Normalizer.Form.NFD. Essentially, I'm just trying to do something like this in Java:
java.text.Normalizer.normalize("Ἑλλάς", java.text.Normalizer.Form.NFD);
I've been trying to do something like this in Clojure, but to no avail:
(import java.text.Normalizer)
(java.text.Normalizer/normalize "Ἑλλάς" java.text.Normalizer.Form/NFD)
Normalizer/normalize
seems to be found ok, but getting at Normalizer.Form.NFD
seems to be the problem as I keep getting the error:
Caused by java.lang.ClassNotFoundException java.text.Normalizer.Form
I'm working on Windows using: Clojure 1.8.0
and Java HotSpot(TM) 64-Bit Server VM 1.8.0_112-b15
I went ahead and tested it in regular Java and it works fine. So the class is installed on the system. Can anyone show me what I'm doing wrong here? Am I calling it incorrectly? Is there something else I need to import perhaps? Any advice is greatly appreciated.