I am facing strange issue here. I am trying to use the character § (alt+21) as a delimiter. But when the source is compiled I see that in the class file this character appears as a character similar to a rectangle []. This is failing my tokenisation. Has someone see this before?
String dtr = "abcd§pqrs";
StringTokenizer st = new StringTokenizer(templateDetails,"§");
in the compiled class file i see the below:
String dtr = "abcd[]pqrs";
StringTokenizer st = new StringTokenizer(templateDetails,"[]");
How do I resolve this? TIA
Use the
\u####syntax to specify a character constant with a specific Unicode number.This will allow you to specify it in pure ASCII without having to mess with file encodings and compiler behavior.