-2

One approach is using the info we know about language ranges. For example, unicode range 30A0–30FF represents Japanese Katakana characters, so if your string consists of characters within that range, you could make an educated guess that it's Japanese and work accordingly.

This requires knowing how to handle unicode language pages in java

Any help please

Maroun
  • 94,125
  • 30
  • 188
  • 241
CSstudent
  • 43
  • 6

1 Answers1

1

Java char is 16 bit unicode. Just get a string and go parsing its characters:

String string = getString(); // returns the string you will parse
boolean japaneseChars = true;
for (ii=0; ii<string.length; ii++) {
    char character = string.charAt(ii);
    if (!(character >= 0x30A0 && character<= 0x30FF)) {
         japaneseChars = false;
    }
}
Jean Waghetti
  • 4,711
  • 1
  • 18
  • 28