I am trying to standardize a set of data. Some of the names were UTF-8 encoded, others were not. What I need to do in JAVA is detect if the name was UTF encoded or not using some form of conditional logic so I can translate each row correctly.
String s1 = "José Flores";
String s1 = "José Flores";
IF [condition] (identify UTF-8)
byte[] utf8Bytes = s1.getBytes("ISO-8859-1");
String s2 = new String(utf8Bytes,"UTF-8");
ELSE
String s2 = s1;