System.out.println(tag.getFirst(FieldKey.ALBUM)); I get a string, display it on the screen: ??????? ???? ?????? ??????? ???? ??????
By practical consideration I found out that this is UTF-16 encoding (probably ?!)
System.out.println(new String(tag.getFirst(FieldKey.ALBUM).getBytes("UTF-16"), "windows-1251")); Brought to the screen: юя С н а ч а л а Б ы л о С о л н ц е ach a юя С н а ч а л а Б ы л о С о л н ц е . !!! At the same time, any text is copied, but this one from the console is not inserted here.
??? The first question is: what is the "yu" at the beginning of the line, on the phone of these letters there is no track in the tags.
Wrote the code:
byte masByte[] = tag.getFirst(FieldKey.ALBUM).getBytes("UTF-16"); for (int i = 0; i < masByte.length; i++) { System.out.print(masByte[i]); } Displays: -2-10-470-190-320-90-320-210-320320-630-50-210-180320-470-180-210-190-100-27
The main question: is there a library of encoding definitions, or an algorithm? PS To determine any popular encoding.
-2 -1 0 -47 0 -19 0 ...- Qwertiy ♦