I was wondering if theres a way to use Java to get the encoding type of a string on the clipboard. (I'd give more details but the question is fairly straight forward).
Ex. I go into a unicode program, copy text, use the Java program to decipher it, and the java program spits out "UTF-16"
To access the clipboard, you can use the awt
datatransfer
classes. To detect the charset, you can use theCharsetDetector
from ICU project.Here is the code :
Here are the imports needed :