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

Similar Messages

  • 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

  • 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.

  • Exporting a PDF so that non-printing objects show but don't print?

    I've just spent a couple hours trying to find an answer to this in the forums, but can't. (The most frustrating was one thread where the original poster said, "I found the answer here," and gave a link that went right back to the main page of the forum. Argh.)
    Okay, anyway ... what I need to do?
    I've got a document with graphics that I want to show up on the pdf when I export it, but that--if a reader prints it--don't print.
    The document looks like a 3-ring binder with "tabs" for each section--just like the real thing. But the rings and tabs go right up to the edge and look terrible when printed, and whose printer can print right at the edge of the paper, anyway? But the tabs work as navigational links while looking a the pdf, and the rings just make it look cool, so I WANT them in the pdf.
    I've tried:
    Turning the entire layer into a non-printing layer (one that "shows" but does not "print"). But when I export it to a pdf, it doesn't show up on the pdf to look at OR to print. So that doesn't work.
    Using the Attribute option to turn each object into a non-printing object, but so far as I can tell, that doesn't do a thing, because they still print from the pdf.
    Exporting with the "create pdf layers" turned on and off. Exporting with the "include non-printing items" turned on and off.
    Basically, I've pretty much tried everything. I gather, from browsing the forums, that this is POSSIBLE, but can't for the life of me figure out what to do to make it happen. (Short of hiding the tabs' layer and creating an entirely separate PDF and calling it "Print version" which is not exactly what I want to do!)
    Is there maybe some magical combination of ons and offs I need to select to make this whole thing work?
    (And, seriously, am I the only person who thinks the supporting documentation is just dreadful? I can't find anything in any of the Help screens that even mentions this, much less explains how to do it.)
    Any help is appreciated!!
    --Deb

    Partial progress...
    The button option (and, I'm using CS3, by the way--I should have said that originally) does work in terms of showing on the pdf but not printing.
    The problem is that it messes up the way the document looks.
    I said it's designed to look like a 3-ring binder with tab-dividers between each section, and each tab has a hyperlink to take you to that section.
    Now, when you've got a paper binder in front of you, the tabs stay in the same sequence, and often overlap a bit (which mine do). The problem I'm having, having turned all of them into buttons, is that when you click on any of them, it "jumps" to the front of the row, so that they don't "flow" in the correct sequence.
    Am I explaining this well? You know, the top-most tab is at the top of the pile, the next one is always below it and above the third one, and so on ... you never see the second tab on TOP of the first one. I'm trying to get the document to act as close to a hard-copy binder as I can, and it did ... except the buttons keep jostling each other for attention...
    I'm going to go play around with this some more now, but ... any suggestions? (Other than restructuring my tabs so that they don't overlap at all?)

  • 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

  • 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;)

  • Detecting non printables characters in a text file

    Hi,
    I need to remove some non printable characters like tabs, carriage returns, line feeds,.... and so!
    i want to do something like
    aString.replaceAll(<the non-printable char>, "");

    str = str.replaceAll("\\P{Print}+", "");From http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Pattern.html, \p{print} is printable characters and \P is the negative of \p.

Maybe you are looking for

  • Adobe Photoshop CC Download error -

    My download of Photoshop CC (2014) onto keeps failing with the following errors: ERROR: DF012: Unable to find file(Seq 16)  ERROR: DF024: Unable to preserve original file at "C:\Program Files (x86)\Common Files\Adobe\Color\Profiles\Recommended\USWebC

  • Pop up note on website / or Maintenance Note

    Hi there, We are doing maintenance on our site for a day and were hoping to make every page for one day only have a note saying  "Our site is under maintenance today - please come back tomorrow" etc Has anyone done this before with BC and know how to

  • Latest Ccritical Update seems to have broken Reporting Services in SharePoint

    The error I'm getting in my logs is: Cannot find site lookup info for request Uri http://spapp-prod0:32843/29869a14ea294b42bf388f54c08b252d/ReportExecution.svc. Here is a screen grab of the actual error. Can anyone help?

  • Page Displays Different in Firefox

    I am new to web site development and new to Dreamweaver.  When I display the webpage in FireFox 3.6.3, the header picture shows below the logo on the left.  It displays fine in IE.  BTW, the font choice is not mine I tried to talk the person out of i

  • Inspection lot creation based on "right" inspection plan version

    I manage inspection plan ( inspection lot origin 01 ) with Change number; in this way I have differents inspection plan version based on date. When I do a Good Entry based on purchase order , I need that system creates inspection lot version based on