I observed that there is a difference between the plain single quote '
and single quote in the word document ’
.
I tried to find the ASCII values from an online ASCII value finder for both the letters. I can find the ASCII value for the first one, but I can not able find the ASCII for the later one(’
).
Even I tried to find the ASCII value using JAVA program like:
public static void main (String[] args) throws java.lang.Exception{
char ch='\’';
System.out.println((int)ch);
}
The Java program also giving an error while trying like this.
So, basically what is the problem with the ’
character?
One thing I know this ’
symbol can produced from a MS word document by typing single quote.
The character can copied into any editor, after copying into the notepad also the symbol will be remains same. But if we type a single quote it will come as plain single quote '
only.
So, basically when we type a program in a Word document and copied to an IDE or some where else to execute it. Then it will be a problem, right? So, how to solve this problem?
What will be the solution other than replacing ’
with '
?
This problem is not specifically related to any language. It is a general problem that every one should be aware.
Notable Edit:
public static void main (String[] args) throws java.lang.Exception{
char ch='’';
System.out.println((int)ch);
}
Which is giving 8217(as one of the answer suggested)
But still how to resolve the problem?