DavidKroukamp
Practically a Master Poster
693 posts since Dec 2011
Reputation Points: 282
Solved Threads: 169
First, you could check that the letters are being transferred correctly from your Runtime exec, and if so, how they have been encoded. Try printing the string with its UniCode numerical values, eg
String s = (the string you get from exec)
for (int i=0; i<s.length();i++)
System.out.println(s.charAt(i) + " = " + (int)s.charAt(i) );
JamesCherrill
Posting Genius
6,373 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073
It's your thread, so you can safely ignore my post and just display a load of code that doesn't even compile. Good luck.
JamesCherrill
Posting Genius
6,373 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073
What do yo mean "you tested my code?" That code was never going to fix anything. It was a diagnostic. You needed to run it and share the results.
Let me explain:
Internally Java uses 16 bit UniCode to hold chars, so accented chars are no problem. But you have input from an 8 bit cmd/file environment where there is no definitive implementation for accents. You are then displaying via fonts that may or may not implement UniCode chars outside the ASCII set.
So your problem could be when the chars are input OR when they are displayed. By printing the numeric values for your text in your program we can see whether the problem is in input or display. Once we know which it is we can progress towards fixing it.
JamesCherrill
Posting Genius
6,373 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073
You are just repeating yourself. I tried to help diagnose this problem but you chose to ignore that. I am wasting no more time here.
JamesCherrill
Posting Genius
6,373 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073
Have you tried printing out the int values of those characters so we can see what they are?
If you want help, you need to print out their values and post it here using a technique as shown by James or this one shown below.
String s = (the string you get from exec)
for (int i=0; i<s.length();i++)
System.out.println(s.charAt(i) + " = " + Integer.toHexString(s.charAt(i)) );
NormR1
Posting Expert
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656
Where are the characters you are having problems with?
I don't see any problems in what you posted.
NormR1
Posting Expert
6,677 posts since Jun 2010
Reputation Points: 1,138
Solved Threads: 656