I am trying to add an urdu string غزل
as shown below:
class UnicodeCheck {
public static void main(String args[]) {
try {
File f = new File("C:/Users/user/Desktop/unicodecheck.txt");
FileWriter writer = new FileWriter(f);
writer.write("غزل");
writer.close();
} catch(Exception exc) {
exc.printStackTrace();
}
}
}
When I try to compile the above program I get this error.
UnicodeCheck.java:1: illegal character: \187
class UnicodeCheck {
^
UnicodeCheck.java:1: illegal character: \191
class UnicodeCheck {
^
2 errors
I do not understand this error. Why do I get this and how can I get over this error?