Decoding non printing characters

I am working with a VI that invokes a telnet session. The responses come back in multiple line formats. What's a quick way to translate the non-printing characters so I can see what to use for delimiters? Using platform dependent EOL does not work which I expected since this data is coming straight from the UUT. 
Thanks,
jvh
Solved!
Go to Solution.

jvh75021 wrote:
I am working with a VI that invokes a telnet session. The responses come back in multiple line formats. What's a quick way to translate the non-printing characters so I can see what to use for delimiters? Using platform dependent EOL does not work which I expected since this data is coming straight from the UUT. 
Thanks,
jvh
I will noramlly put the data in a string indicator and set it for either slash code or hex display. If that gets to hard to read, cast the string as an array of bytes and display that.
Ben
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction

Similar Messages

  • Hiding non printing characters

    I have migrated character mode report from 2.5 to 10g and mapped the o/p to open in textpad using orarrp.
    But i am getting non printing characters in the o/p when viewed in any editor but in print out they won't appear.
    So how to hide this non printing characters.
    The characters are like "square box" followed by "g","square box" followed by "m","square box" followed by "p"
    This is the prt file which i am using
    printer "wide"
    height 72
    width 132
    code "01" esc 15
    code "18" 18
    code "10" esc 80
    code "12" esc 77
    code "15" esc "g"
    after page control(L)
    return control(M)
    linefeed control(J)
    pls help

    so use the Document
    pattern it after the FixedLengthDocument in the tutorial
    store the real string in the extended document class
    when the user types an invalid character, it is not added to the text pane.
    there is a getText method in the Document (i think)
    have it return the real string with all the characters
    when the user types in the textPane, it will be added to the string in your
    document class but will not be seen in the text area because you have
    filtered it.
    I think you can figure it out. I haven't tested this exact theory but have done
    something similar

  • Non printing characters

    Hi,
    I was cutting and pasting code from a post
    http://forum.java.sun.com/thread.jspa?forumID=54&threadID=766671
    To have some fun and see if I could get it to work.
    Had some trouble at first, got some advice and eventually got it to work.
    When I pasted it into TextEdit (standard text editor on my mac) and tried to compile,
    I ended up with100 errors per file. Somewhere along the line I figured
    that the editor was formatting things wrong or including non printing characters
    of some type and screwing up the system. So I downloaded JEdit cut and
    pasted and everything worked fine.
    so, my question is this: Can someone explain this stuation or point me to a resource
    of information on editors and how they work and what to look out for.
    I'm just starting the learning process...seems like there is a lot I need to learn.
    Thanks Bill

    So something else must have been a problem. But
    without any error messages or other details, I
    couldn't possibly tell what.After I read your reply I thought; maybe I did screw up somewhere else, so
    I did the copy and pasting again to try and reproduce the errors.
    I copied from the forum and pasted into TextEdit.
    Saved as plain text (UTF-16)
    I tried to compile and got the following results.
    Since I pasted into JEdit and everyrthing compiled
    I figuered the problem had to do with editor, or formatting.
    Welcome to Darwin!
    bill-macleods-computer:~ bill$ cd desktop/test2
    bill-macleods-computer:~/desktop/test2 bill$ javac *java -d ~/desktop/test2
    JavaTester.java:1: 'class' or 'interface' expected
    ??/* File: JavaTester.java
    ^
    JavaTester.java:1: illegal character: \731
    ??/* File: JavaTester.java
    ^
    JavaTester.java:1: illegal character: \0
    ??/* File: JavaTester.java
    ^
    JavaTester.java:1: illegal character: \0
    ??/* File: JavaTester.java
    ^
    JavaTester.java:1: illegal character: \0
    ??/* File: JavaTester.java
    ^
    JavaTester.java:1: illegal character: \0
    ??/* File: JavaTester.java
    ^
    JavaTester.java:1: illegal character: \0
    ??/* File: JavaTester.java
    ^
    JavaTester.java:1: illegal character: \0
    ??/* File: JavaTester.java
    ^
    JavaTester.java:2: illegal character: \0
    ^
    JavaTester.java:2: illegal character: \0
    ^
    JavaTester.java:2: illegal character: \0
    ^
    JavaTester.java:2: illegal character: \0
    ^
    JavaTester.java:3: illegal character: \0
    package com.company.javatester.gui;
    ^
    JavaTester.java:3: illegal character: \0
    package com.company.javatester.gui;
    ^
    JavaTester.java:3: illegal character: \0
    package com.company.javatester.gui;
    ^
    JavaTester.java:3: illegal character: \0
    package com.company.javatester.gui;
    ^
    JavaTester.java:3: illegal character: \0
    package com.company.javatester.gui;
    ^
    JavaTester.java:3: illegal character: \0
    package com.company.javatester.gui;
    ^
    JavaTester.java:4: illegal character: \0
    ^
    JavaTester.java:4: illegal character: \8224
    ^
    JavaTester.java:4: illegal character: \0
    ^
    JavaTester.java:5: illegal character: \0
    import com.company.javatester.data.QuestionDAO;
    ^
    JavaTester.java:5: illegal character: \0
    import com.company.javatester.data.QuestionDAO;
    ^
    JavaTester.java:5: illegal character: \0
    import com.company.javatester.data.QuestionDAO;
    ^
    JavaTester.java:5: illegal character: \0
    import com.company.javatester.data.QuestionDAO;
    ^
    JavaTester.java:5: illegal character: \0
    import com.company.javatester.data.QuestionDAO;
    ^
    JavaTester.java:5: illegal character: \0
    import com.company.javatester.data.QuestionDAO;
    ^
    JavaTester.java:5: illegal character: \0
    import com.company.javatester.data.QuestionDAO;
    ^
    JavaTester.java:6: illegal character: \0
    import javax.swing.*;
    ^
    JavaTester.java:6: illegal character: \0
    import javax.swing.*;
    ^
    JavaTester.java:6: illegal character: \0
    import javax.swing.*;
    ^
    JavaTester.java:6: illegal character: \0
    import javax.swing.*;
    ^
    JavaTester.java:6: illegal character: \0
    import javax.swing.*;
    ^
    JavaTester.java:6: illegal character: \0
    import javax.swing.*;
    ^
    JavaTester.java:7: illegal character: \0
    ^
    JavaTester.java:7: illegal character: \8224
    ^
    JavaTester.java:7: illegal character: \0
    ^
    JavaTester.java:8: illegal character: \0
    ^
    JavaTester.java:8: illegal character: \0
    ^
    JavaTester.java:8: illegal character: \0
    ^
    JavaTester.java:8: illegal character: \0
    ^
    JavaTester.java:9: illegal character: \0
    * A Java testing application. It provides user's with various java related
    ^
    JavaTester.java:9: illegal character: \0
    * A Java testing application. It provides user's with various java related
    ^
    JavaTester.java:9: illegal character: \0
    * A Java testing application. It provides user's with various java related
    ^
    JavaTester.java:9: illegal character: \0
    * A Java testing application. It provides user's with various java related
    ^
    JavaTester.java:9: illegal character: \0
    * A Java testing application. It provides user's with various java related
    ^
    JavaTester.java:9: illegal character: \0
    * A Java testing application. It provides user's with various java related
    ^
    JavaTester.java:9: illegal character: \0
    * A Java testing application. It provides user's with various java related
    ^
    JavaTester.java:9: illegal character: \0
    * A Java testing application. It provides user's with various java related
    ^
    JavaTester.java:9: illegal character: \0
    * A Java testing application. It provides user's with various java related
    ^
    JavaTester.java:9: illegal character: \0
    * A Java testing application. It provides user's with various java related
    ^
    JavaTester.java:9: illegal character: \0
    * A Java testing application. It provides user's with various java related
    ^
    JavaTester.java:9: illegal character: \0
    * A Java testing application. It provides user's with various java related
    ^
    JavaTester.java:9: unclosed character literal
    * A Java testing application. It provides user's with various java related
    ^
    JavaTester.java:9: illegal character: \0
    * A Java testing application. It provides user's with various java related
    ^
    JavaTester.java:9: illegal character: \0
    * A Java testing application. It provides user's with various java related
    ^
    JavaTester.java:9: illegal character: \0
    * A Java testing application. It provides user's with various java related
    ^
    JavaTester.java:9: illegal character: \0
    * A Java testing application. It provides user's with various java related
    ^
    JavaTester.java:10: illegal character: \0
    * questions. It can be run as either an applet or an application. If it is
    ^
    JavaTester.java:10: illegal character: \0
    * questions. It can be run as either an applet or an application. If it is
    ^
    JavaTester.java:10: illegal character: \0
    * questions. It can be run as either an applet or an application. If it is
    ^
    JavaTester.java:10: illegal character: \0
    * questions. It can be run as either an applet or an application. If it is
    ^
    JavaTester.java:10: illegal character: \0
    * questions. It can be run as either an applet or an application. If it is
    ^
    JavaTester.java:10: illegal character: \0
    * questions. It can be run as either an applet or an application. If it is
    ^
    JavaTester.java:10: illegal character: \0
    * questions. It can be run as either an applet or an application. If it is
    ^
    JavaTester.java:10: illegal character: \0
    * questions. It can be run as either an applet or an application. If it is
    ^
    JavaTester.java:10: illegal character: \0
    * questions. It can be run as either an applet or an application. If it is
    ^
    JavaTester.java:10: illegal character: \0
    * questions. It can be run as either an applet or an application. If it is
    ^
    JavaTester.java:10: illegal character: \0
    * questions. It can be run as either an applet or an application. If it is
    ^
    JavaTester.java:10: illegal character: \0
    * questions. It can be run as either an applet or an application. If it is
    ^
    JavaTester.java:10: illegal character: \0
    * questions. It can be run as either an applet or an application. If it is
    ^
    JavaTester.java:10: illegal character: \0
    * questions. It can be run as either an applet or an application. If it is
    ^
    JavaTester.java:10: illegal character: \0
    * questions. It can be run as either an applet or an application. If it is
    ^
    JavaTester.java:10: illegal character: \0
    * questions. It can be run as either an applet or an application. If it is
    ^
    JavaTester.java:10: illegal character: \0
    * questions. It can be run as either an applet or an application. If it is
    ^
    JavaTester.java:10: illegal character: \0
    * questions. It can be run as either an applet or an application. If it is
    ^
    JavaTester.java:10: illegal character: \0
    * questions. It can be run as either an applet or an application. If it is
    ^
    JavaTester.java:10: illegal character: \0
    * questions. It can be run as either an applet or an application. If it is
    ^
    JavaTester.java:10: illegal character: \0
    * questions. It can be run as either an applet or an application. If it is
    ^
    JavaTester.java:10: illegal character: \0
    * questions. It can be run as either an applet or an application. If it is
    ^
    JavaTester.java:11: illegal character: \0
    * run as an applet, then the applet will need to be signed if is to access
    ^
    JavaTester.java:11: illegal character: \0
    * run as an applet, then the applet will need to be signed if is to access
    ^
    JavaTester.java:11: illegal character: \0
    * run as an applet, then the applet will need to be signed if is to access
    ^
    JavaTester.java:11: illegal character: \0
    * run as an applet, then the applet will need to be signed if is to access
    ^
    JavaTester.java:11: illegal character: \0
    * run as an applet, then the applet will need to be signed if is to access
    ^
    JavaTester.java:11: illegal character: \0
    * run as an applet, then the applet will need to be signed if is to access
    ^
    JavaTester.java:11: illegal character: \0
    * run as an applet, then the applet will need to be signed if is to access
    ^
    JavaTester.java:11: illegal character: \0
    * run as an applet, then the applet will need to be signed if is to access
    ^
    JavaTester.java:11: illegal character: \0
    * run as an applet, then the applet will need to be signed if is to access
    ^
    JavaTester.java:11: illegal character: \0
    * run as an applet, then the applet will need to be signed if is to access
    ^
    JavaTester.java:11: illegal character: \0
    * run as an applet, then the applet will need to be signed if is to access
    ^
    JavaTester.java:11: illegal character: \0
    * run as an applet, then the applet will need to be signed if is to access
    ^
    JavaTester.java:11: illegal character: \0
    * run as an applet, then the applet will need to be signed if is to access
    ^
    JavaTester.java:11: illegal character: \0
    * run as an applet, then the applet will need to be signed if is to access
    ^
    JavaTester.java:11: illegal character: \0
    * run as an applet, then the applet will need to be signed if is to access
    ^
    JavaTester.java:11: illegal character: \0
    * run as an applet, then the applet will need to be signed if is to access
    ^
    JavaTester.java:11: illegal character: \0
    * run as an applet, then the applet will need to be signed if is to access
    ^
    JavaTester.java:11: illegal character: \0
    * run as an applet, then the applet will need to be signed if is to access
    ^
    JavaTester.java:11: illegal character: \0
    * run as an applet, then the applet will need to be signed if is to access
    ^
    JavaTester.java:11: illegal character: \0
    * run as an applet, then the applet will need to be signed if is to access
    ^
    100 errors
    bill-macleods-computer:~/desktop/test2 bill$

  • How to show invisibles (non-printing characters) in Keynote?

    Great thanks to anyone who can help find what in Keynote '09 is clicked or keyed to show invisibles (non-printing characters).

    I have this same problem.  It used to be under View in Keynote '08 but can't find it anywhere in '09 and it won't even show up in the help.  AAAAhhhhh, come on Apple...where'd you put it?

  • Making non-printing characters visible

    Hello all,
    I am trying to find a method that will make spaces, non-breaking spaces, newlines, tabs, etc have a graphic representataion in rendered text, like the "Show Invisibles" or "Show Codes" features of most word processors. I tried several Google searches but to no avail. Does anyone know if this is possible in Java?

    Hi,
    There is no such function in Java as far as I know. You have to simulate it yourself. You can compute the advance, etc. using java.awt.font.LineMetrics.

  • Please help with newline non-printing character in JTextPane.

    Hi.
    I need to implement "View non-printing characters" feature in my JTextPane.
    So when this feature is toggled, the newline character is displayed at the end of every line like in Microsot Word editor.
    I been digging around for few hours now and I cant find a solution for this.
    Please help me with any tips guys.

    StanislavL:
    ok i digged around and i found code example... i got my code to show "X" at the end of every line as a newline character. here is code I used:
    import javax.swing.text.StyledEditorKit;
    import javax.swing.text.ViewFactory;
    import javax.swing.text.Element;
    import javax.swing.text.View;
    import javax.swing.text.AbstractDocument;
    import javax.swing.text.LabelView;
    import javax.swing.text.IconView;
    import javax.swing.text.StyleConstants;
    import javax.swing.text.ComponentView;
    import javax.swing.text.BoxView;
    import java.awt.Graphics;
    import java.awt.Shape;
    import java.awt.Rectangle;
    class MyEditorKit extends StyledEditorKit
         public ViewFactory getViewFactory()
              return new MyRTFViewFactory();
    class MyRTFViewFactory implements ViewFactory
         public View create(Element elem)
              String kind = elem.getName();
              if (kind != null)
                   if (kind.equals(AbstractDocument.ContentElementName)) {
              return new LabelView(elem);
                   } else if (kind.equals(AbstractDocument.ParagraphElementName)) {
    //              return new ParagraphView(elem);
                        return new MyParagraphView(elem);
                   } else if (kind.equals(AbstractDocument.SectionElementName)) {
    //              return new BoxView(elem, View.Y_AXIS);
                        return new MySectionView(elem, View.Y_AXIS);
                   } else if (kind.equals(StyleConstants.ComponentElementName)) {
                        return new ComponentView(elem);
                   } else if (kind.equals(StyleConstants.IconElementName)) {
                        return new IconView(elem);
                   // default to text display
                   return new LabelView(elem);
    class MySectionView extends BoxView {
         public MySectionView(Element e, int axis)
              super(e,axis);
         public void paintChild(Graphics g,Rectangle r,int n) {
              if (n>0) {
                   MyParagraphView child=(MyParagraphView)this.getView(n-1);
                   int shift=child.shift+child.childCount;
                   MyParagraphView current=(MyParagraphView)this.getView(n);
                   current.shift=shift;
              super.paintChild(g,r,n);
    class MyParagraphView extends javax.swing.text.ParagraphView
         public int childCount;
         public int shift=0;
         public MyParagraphView(Element e)
              super(e);
              short top=0;
              short left=20;
              short bottom=0;
              short right=0;
              this.setInsets(top,left,bottom,right);
         public void paint(Graphics g, Shape a)
              childCount=this.getViewCount();
              super.paint (g,a);
              int rowCountInThisParagraph=this.getViewCount(); //<----- YOU HAVE REAL ROW COUNT FOR ONE PARAGRAPH}
              System.err.println(rowCountInThisParagraph);
         public void paintChild(Graphics g,Rectangle r,int n) {
              super.paintChild(g,r,n);
              //g.drawString(Integer.toString(shift+n+1),r.x-20,r.y+r.height-3); // line number
              g.drawString("X",r.x+r.width,r.y+r.height-3);
    }this line here draws "X":
    g.drawString("X",r.x+r.width,r.y+r.height-3);How would I modify this to draw a small picture there?
    Thanx a lot.

  • How to print the HEX values of non-displayable characters!

    I am trying to tokenize a string that contains non-displayable characters i.e. EBCDIC or ASCII. How can I print the HEX values of the non-displayable characters. e.g.
    "StartTEST1TEST2TEST3TEST4TEST5TEST6TEST7TEST812END"
    How can print the HEX values of in the above string. Any help is appreciated.
    Thanks

        char ch = 28; // or whatever character you want to look at.
        String hexString = Integer.toHexString(ch);
        System.out.println(hexString);

  • Processsing non-printing ASCII characters using ABAP

    Hi All,
    I would like to process a GUI field input that contains a non-printing ASCII character. It is actually from barcode being read into a GUI field that is then picked up by an ABAP program e.g. in readable format looks like this: 123456789 but actually contains a non-printing ASCII character (ASCII char 29) used as a data separator e.g. 1234<sep>567<sep>89.
    I would like to parse the input using ABAP at the non-printing ASCII character so that I have 3 variables A=1234 & B=567 & C=89.
    How should I best tackle this?
    Cheers,
    N.

    Pls check this...
    DATA: hx29 type x value '29'.
    data : wa_hx29(1).
    data : wa_str(30) type c.
    data : wa_str1(10),wa_str2(10),wa_str3(7).
    wa_hx29 = hx29.
    split wa_str at wa_hx29 into wa_str1 wa_str2 wa_str3.

  • Non-English characters

    Hello, I have read several times that since Java uses Unicode, it solves the problems of non-English characters automatically or something like that.
    But my app is not working as expected. Would someone help please?
    I have a client/server combo written in Java. The server can send messages in English or Japanese. The Japanese messages are hard-coded as String literals in the server source code. On the client side, they are displayed on a JEditorPane. But the Japanese characters are all garbled. The OS on the server side and client side are, of course, different.
    My supposition, which is obviously wrong as it is not working, is that since both ends of communication are Java app, I need not worry about any encoding conversions for String literals.
    Suggest me what is wrong here?

    How is the required encoding/decoding supposed to be done?
    When I didn't worry about non-English characters, I did the following, which WORKED.
    // SENDER side
    Socket socket ;
    PrintWriter     out = new PrintWriter(socket.getOutputStream(),true);
    String outMessage = "my message";
    out.println(outMessage);//RECEIVER
    Socket socket ;
    BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
    String inMessage =  in.readLine();When non-English characters are involved, I did the following, which DID NOT WORK. Please someone correct me.
    // SENDER side
    Socket socket ;
    PrintWriter     out = new PrintWriter(socket.getOutputStream(),true);
    String outMessage = "my message";
    String utfString = new String(outMessage.getBytes(),"UTF-8");
    out.println(utfString);//RECEIVER
    Socket socket ;
    InputStreamReader ins = new InputStreamReader(clientSocket.getInputStream(),"UTF-8");
    BufferedReader in = new BufferedReader(ins);
    String inMessage =  in.readLine();The received message is still garbled.

  • Odd number of non-english characters get broken in windows-chrome and ff

    I developed jnlp applet which prints out the user input.
    When I put odd number of non-english characters(eg: chinese), chrome and firefox browser prints out the last character as question mark.
    input : 가
    output : 가��
    I checked on java console that the character is correct.
    It must be bug in communication of applet to chrome browser.
    IE prints out correctly.
    I can resolve the issue by appending white space on applet and remove it on java script.
    Anyone has any clue on the issue?
    Codes are as follows.
    MainApplet.Java
    public class MainApplet extends JApplet implements JSInterface{//, Runnable {
         public int stringOut(String sData) {
              OutData = sData;
              return 0;
    js File
    function TSToolkitRealWrapper ()
         var OutData;
         var OutDataNum;
    var TSToolkit = new TSToolkitRealWrapper();
    var attributes = { id:'TSToolkitReal',code:'tradesign.pkitoolkit.applet.MainApplet', width:100, height:100} ;
    var parameters = {jnlp_href: getContextPath() + '/download/pkitoolkit.jnlp',
                         separate_jvm:true, classloader_cache:false} ;
    TSToolkitRealWrapper.prototype.stringOut=function(str)
              var      nRet = TSToolkitReal.stringOut(str)     ;
              this.OutData= TSToolkitReal.OutData;
              return      nRet;
    HTML
    <SCRIPT language=javascript>
    <!--
    function StringOut(form)
         var data = form.data.value;
         var nRet = 0;
         var base64Data;
         nRet = TSToolkit.stringOut(data);
         if (nRet > 0)
              alert(nRet + " : " + TSToolkit.GetErrorMessage());
         else
              form.data1.value = TSToolkit.OutData;
    -->
    </SCRIPT>
    Edited by: user13496918 on 2013. 3. 20 오후 7:29
    Edited by: user13496918 on 2013. 3. 20 오후 7:39
    Edited by: user13496918 on 2013. 3. 20 오후 9:17
    Edited by: user13496918 on 2013. 3. 20 오후 9:18

    I checked on java console that the character is correct.So it isn't a Java problem.
    It must be bug in communication of applet to chrome browser.So tell the people who make the Chrome browser.
    IE prints out correctly.That's a change. I've just spent nine days tracking down an IE applet problem and I'm not finished yet.
    Please omit the boldface next time. We can read. Boldface doesn't help; it makes it worse.

  • Non-english characters in sqlplus

    Friends,
    9.0.1,10.2.0.1
    CAn the non-english characters be displayed in sqlplus prompt?
    I have to print the data with some hindi charcaters like name from the report generated via proc.
    What is teh workaround for this?
    Thanks

    Hi,
    I have RH Linux 7.3.
    Here is my situation.
    I have some tables that have some columns.In these columns i need to store data in hindi.
    The database character set(nls_characterset) is US7ASCII.
    The datatypes of the columns is varchar2 type.
    The tables are accessed through Pro*c and the proc code generates the report.
    The data in these reports needs to be printed out and the corresponding data has to be in hindi.
    So i have to do two things
    1) On query the tables, the user should see hindi data along with english data.
    2) The printed report should also contain hindi data.
    Questions:
    1) If i change the charcater set by the command:
    alter database character set AL32UTF8;
    and OS locale to UTF-8
    Would these chnages solve the purpose?
    2) Or do i need to recreate the database with AL32UTF8 and exp/imp all the data?
    3)Any other advice/option?
    Thanks

  • Encrypting non-English characters

    Hi,
    I have this application which has to do the following
    Scenario (i)
    - Read ENCODED string SE from Network Source NS1 (Native,Non-JAVA)
    - Decode SE to SD using the same charset as NS1
    - Apply some transformation to SD to get SD2
    - Encode SD2 to get SE2 using the same charset as Network Source NS2
    (Native, Non-JAVA)
    - Send SE2 to NS2
    - NS2 gets what it expects without any problems :))
    Scenario (ii)
    - Read ENCODED string SE from Network Source NS1 (Native,Non-JAVA)
    - Decode SE to SD using the same charset as NS1
    - Apply some transformation to SD to get SD2
    - Get the bytes from SD2 as BSD2
    - Encode BSD2 to get BSE2 using the same charset as Network Source NS2
    (Native, Non-JAVA)
    - Encrypt BSE2 to BSE2_Enc
    - Send BSE2_Enc to NS2 (Native,Non-JAVA)
    - NS2 does not gets what it expects :((
    (It recieves English text OK but it gets ???? for non-English)
    The charset being used is windows-1256 (at NS1,NS2 and my application)
    Encryption is being done using BouncyCastle TwoFish w/ 256 bit keys
    Reading/Writing from/to network is being done over SocketChannel
    Get the bytes from SD2 as BSD2 => byte [] BSD2 = SD2.getBytes()It seems the non-Enlish characters are getting lost when I go SD2.getBytes()
    and they get encrypted as 'lost-non-English characters' ;)
    And when they get decrypted at NS2, they are displayed as 'lost-non-English
    characters' :)) i.e. ??????? .. so on
    Is there a way I can encrypt non-English plain text without losing information ?
    (without having to implement a TwoFish engine in my application itself)

    1) Bytes are not characters. Characters are UNICODE
    and have a byte representation defined by an encoding
    scheme. It is usually wrong to use the default
    encoding given by String.getBytes(). One should realy
    use String.getByte(encoding) eg
    "fred".getBytes("UTF-8");Awwllright ... got that :)) Thanks buddy
    2) Not having access to your code makes it difficult
    but make sure you are not converting encrypted bytes
    to a String using new String(encrypted bytes); No .. I am not doing that.
    3) Again, not having access to your code makes it
    difficult , but when you display your Strings make
    sure that you use a Font that has representations for
    all the UNICODE characters you wish to display. It is
    normal for any character that does not have a valid
    glyph in a gien font to display as a box.That infrastructure exists and is working fine ... as I mentioned
    this is working OK when plain text is being used.
    The problem was with using the getBytes() rather than getBytes("windows-1256")
    Its working now ... thanks alot .. again. I wonder how that never occurred to me.

  • Cannot rename file with non-ASCII characters when using the

    My application moves files from one directory to another by calling File[] srcFiles = srcDir.listFiles() to get a list of files in the source directory, and then calling srcFiles.renameTo(destFile) to rename each file.
    This does not work (renameTo returns false and the file is not moved) under the following circumstances:
    - the file's leaf name contains non-ASCII characters, for example "�"
    - the OS is Solaris 9
    - the LANG and LC_* environment variables are unset, i.e. the C locale is being used
    If I set the LANG environment variable to, for example, en_GB.UTF-8 then the rename succeeds.
    I have tried calling srcFiles[index].getName().getBytes("UTF-8") and the non-ASCII characters are being replaced with ? (0x3f) characters when LANG is unset.
    Is this a bug in the JRE? I would argue that since my code does not actually manipulate the filename (I just use the File object that File.listFiles() gives me) then the rename should succeed. Of course I would not expect the file name to be displayed correctly if I printed it out.
    I have reproduced this behaviour with JDK 1.4.2_05 and 1.5.0_04 on Solaris 9.
    Francis

    Thanks for the info Alan.
    I considered setting the locale in the environment (this sounds like the "correct" fix to me and we might implement it later), but this application shares a WebLogic server with many other applications so we would have to do a huge amount of testing to make sure that the locale change wouldn't break the other apps. In the end I worked around the problem by making the code that generates the filenames in the first place strip out any non-ASCII characters (the names of the files are not critically important).
    Looking forward to JSR-203, in the meantime perhaps a note about this behaviour in the java.io.File javadoc would be useful.

  • Prevent Non-English Characters on JSP forms

    I was hoping to get any programming tips/ideas to prevent users from entering non-english text on web-forms.
    Any feedback would be greatly appreciated. Thanks.

    I have a jsp page something like:
    <tr>
    <td colspan=2> </td>
    <td colspan=2>
    <textarea name="title" cols="<%=cols%>" rows="3" wrap><%= form.getTitle()%></textarea>
    </td>
    </tr>
    When the user submits the page, I do the form validation in the java formhandler. I was hoping that I could somehow compare the ascii codes of the character to ensure user is entering only english characters.
    The following is the code, I have written in java the form-handler
    for (int i =0 ; i < title.length() ; i++) {
         char c = title.charAt(i);
         System.out.println("c = " + c + ", ascii = " +(int)'c');
         if (int(c) > 127) {
              setErrorMessage(ID.QUESTION.TITLE, "Non-English characters are not allowed. Please enter the required information only in Enlgish.");     
    But for some reason which I am not able to debug, is that no matter what character I enter english or non-english its ascii equivalent i.e. the int(c) value getting printed out is always 99. Moreover even if I enter a non-english character, in the system.out it is printing its english equivalent...if that makes any sense...
    I hope I was able to explain my problem...Any help/feedback would be greatly appreciated.
    Thanks.

  • Non-ANSI characters in Java

    class test {
         public static void main (String[] args) {
              System.out.print("&#49352;");
    }Is it possible to print non-ANSI characters like the above? Since obviously saving this code in ANSI will remove the non-ANSI characters.

    The code you posted runs OK on my computer - both in Eclipse and in the console. It prints a character somewhat like a rugby player about to attempt to convert a try.
    Korean, I think.
    Anyway Google thinks so. It directed me to this web site which has the character as its page title. www.woorimal.net/hangul/hyundai-poem/sae.htm
    The poem in question has the English title "New".
    1
    Non covered the sky
    Both divers ability of the wind
    Come Athens
    Both the shade of trees, birds
    Sing. It is patterned knowledge of the line
    It is knowledge of the bird line 19
    Two Judgment beak,
    Two die in the ward
    Warm temperatures (&#20307;&#28201;) divide.
    2
    Bird uleo
    Rather than creating it.
    Presented gyotae (&#23047;&#24577;)
    Love is the expression (&#20551;&#39280;).
    3
    --- Catcher Schneider is a &#99;racker
    As a pure (&#32431;&#31929;) targets, but
    It is meant shooting
    A wet blood saee nothing more than a virtual (&#20260;)

Maybe you are looking for

  • Applications not starting or loading

    Seems odd my safari, mail adobe reader apps do not open at all. The mail icon will jump up but will not load anything. Any ideas. Seems strange mostly apple apps. Is there an app or something that opens these and is not working.

  • Creation of Purchase Order Without Requisition

    Hi Experts iam new to this forum Can u please explain with navigation that how to create a Purchase order without requisition ??

  • How to create a splash screen?

    I was wondering how to create the splash screen that shows up when you just load the program. My program takes a bit to load, because it sets to change the look and feel to system dependent. So, I want to have a splash screen like the one that eclips

  • The most frustrating software i have ever used.

    I am getting an error message "The localized resource files for this application could not be loaded.  Please reinstall or repair the application and try again.  This I have been doing since 9:00 a.m. this morning.  I purchased the Student version of

  • Is it ok to charge iPhone 4s with a different ac adaptor

    It's input is 100-240V, 0.2 A. Output is 5.1V, 850mA Will it damage the iPhone or battery?