retriving escape unicode sequences from files ...

Discussion in 'Java' started by qwertmonkey, Aug 4, 2012.

  1. qwertmonkey

    qwertmonkey Guest

    From:

    // __
    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); }

    --- BBBS/Li6 v4.10 Dada-1
    * Origin: Prism bbs (1:261/38)
    --- Synchronet 3.16a-Win32 NewsLink 1.98
    Time Warp of the Future BBS - telnet://time.synchro.net:24
    qwertmonkey, Aug 4, 2012
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    8
    Views:
    318
    Arne Vajhøj
    Aug 7, 2012
  2. Replies:
    0
    Views:
    118
  3. qwertmonkey
    Replies:
    8
    Views:
    264
    Arne Vajhøj
    Aug 8, 2012
  4. qwertmonkey
    Replies:
    0
    Views:
    192
    qwertmonkey
    Aug 3, 2012
  5. Replies:
    0
    Views:
    172
Loading...

Share This Page