Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #17041 > unrolled thread

retriving escape unicode sequences from files ...

Started byqwertmonkey@syberianoutpost.ru
First post2012-08-03 18:50 +0000
Last post2012-08-03 18:50 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.java.programmer


Contents

  retriving escape unicode sequences from files ... qwertmonkey@syberianoutpost.ru - 2012-08-03 18:50 +0000

#17041 — retriving escape unicode sequences from files ...

Fromqwertmonkey@syberianoutpost.ru
Date2012-08-03 18:50 +0000
Subjectretriving escape unicode sequences from files ...
Message-ID<jvh6i2$v2s$1@speranza.aioe.org>
// __ 
  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); }

[toc] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web