R
Raga
Hi,
This is what is being done. Euro sign is initialized as a String & then
written through PrintWriter into a custom stream, where it's converted
to type int[]. When this is read in the client end & displayed, it is
getting displayed as a '?'. In short, this is how it is coded:
String string = new String("€");
PrintWriter writer = new PrintWriter(new customOutputStream(), true);
writer.print(string);
In the custom stream, the write() method is defined like this:
public void write(int arg0) throws IOException
{
data[top][j++] = arg0;
}
where data[][] is an 'int' array.
For the string "€", if I print the value of data[][], am getting some
numbers. How do I verify if the numbers that I get corresponding to the
String "€" is correct?
In the client, a method gets data[][] & writes to the screen. Am
getting '?'. If I set the OutputStream's encoding as UTF-8, am getting
3 '?'s. For UTF-16. am getting 2 '?'s. Can someone please throw some
light on this?
Thanks.
This is what is being done. Euro sign is initialized as a String & then
written through PrintWriter into a custom stream, where it's converted
to type int[]. When this is read in the client end & displayed, it is
getting displayed as a '?'. In short, this is how it is coded:
String string = new String("€");
PrintWriter writer = new PrintWriter(new customOutputStream(), true);
writer.print(string);
In the custom stream, the write() method is defined like this:
public void write(int arg0) throws IOException
{
data[top][j++] = arg0;
}
where data[][] is an 'int' array.
For the string "€", if I print the value of data[][], am getting some
numbers. How do I verify if the numbers that I get corresponding to the
String "€" is correct?
In the client, a method gets data[][] & writes to the screen. Am
getting '?'. If I set the OutputStream's encoding as UTF-8, am getting
3 '?'s. For UTF-16. am getting 2 '?'s. Can someone please throw some
light on this?
Thanks.