G
Gerry Lawrence
I'm having a problem with a simple method I've created for parsing an
input variable. The input data is in utf-8. When this gets run, it
just turns the data into a single question mark for each character
read. I know I need to change the variable type to bytes and possibly
do another conversion after this, but all my novice attempts based on
various archived posts have failed. Here is the code:
public static void MyStringParse(String line) {
try {
StringTokenizer input = new StringTokenizer(line,"\",false);
System.out.print(input.nextToken());
while (input.hasMoreTokens()) {
System.out.print(" | " + input.nextToken());
}
System.out.println();
}
catch (Exception e) {
e.printStackTrace();
}
}
Many Thanks in advance,
Gerry
input variable. The input data is in utf-8. When this gets run, it
just turns the data into a single question mark for each character
read. I know I need to change the variable type to bytes and possibly
do another conversion after this, but all my novice attempts based on
various archived posts have failed. Here is the code:
public static void MyStringParse(String line) {
try {
StringTokenizer input = new StringTokenizer(line,"\",false);
System.out.print(input.nextToken());
while (input.hasMoreTokens()) {
System.out.print(" | " + input.nextToken());
}
System.out.println();
}
catch (Exception e) {
e.printStackTrace();
}
}
Many Thanks in advance,
Gerry