retriving escape unicode sequences from files ...

Q

qwertmonkey

// __
byte[] bBfr;
char[] cBfr = new char[1024];
// __
String aEncUTF8 = "UTF-8";
String aUniKdEnk = "\u0066\u0072\u0061\u006e\u00e7\u0061\u0069\u0073";
// __
try{
// __
InputStream IS = new ByteArrayInputStream(aUniKdEnk.getBytes());
Reader Rdr = new InputStreamReader(IS, aEncUTF8);
// __
ByteArrayOutputStream bArOS = new ByteArrayOutputStream();
Writer Wrtr = new OutputStreamWriter(bArOS, aEncUTF8);
// __
int numChars = Rdr.read(cBfr);
if(numChars > 0) {
bArOS.reset();
Wrtr.write(cBfr, 0, numChars);
Wrtr.flush();
bBfr = bArOS.toByteArray();
System.err.println("// __ |" + (new String(bBfr)) + "|");
}// (numChars > 0)
// __
}catch(UnsupportedEncodingException UEncX){ UEncX.printStackTrace(System.err); }
catch(IOException IOX) { IOX.printStackTrace(System.err); }
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top