Character display

Hi, i'm getting an array of bytes from a socket connection to a remote computer. When i try to convert the bytes to a string to see the content, i'm getting ANSI control characters:
6 bytes free ?[25;1H?[0mC:\WINNT\system32>
?[25;19H?D?[25;1H?[0m
?[25;1H?[25;1H?[0mC:\WIN
NT\system32> ?[25;19
H
?D?[25;1H?[0m
?[25;1H?[25;1H?[0mC:\WINNT\system32>
?[25;19H
?D?[25;1H?[0m
?[25;1H?[25;1H?[0mC:\WINNT\system32>
?[25;19H
?[1;1H?[0m Volume in drive D has no label.
?[2;1H?[0m Volume Serial Number is A8A3-BC86
?[3;1H?[0m
?[4;1H?[0m Directory of D:\
?[5;1H?[0m
?[6;1H?[0m08/15/01 03:59p <DIR>
backup
?[7;1H?[0m11/13/01 11:40a
The code is:
byte[] bte = new byte[256];
bte = poolConn.readBuffer();
String sBuff = new String(bte);
//String sBuff = new String(bte, "Cp850");
System.out.println(sBuff);
I'm using JDK 1.3.1 on W2K. The problem is when i try to connect to a WNT or W2K machine, it doesn't happen when i connect to a Linux or to a Solaris machine.
Anybody knows how to avoid or to convert again these characters?
Thanks in advance.

The ansi codes should be able to be ignored, the trick is figuring out the patterns to ignore. It looks like they all satisfy a pattern like...
"ESC[" {any non-alpha characters} {alpha character}
You could apply a regular expression over every string you get back to remove these patterns from the string.
Any idea why it's printing ANSI? It doesn't do it when you just run cmd.exe and capture the output.

Similar Messages

  • Character display problems....11g connecting to SQL server

    Hi Gurus,
    db: 11.2
    os: redhat 5.5
    there is a problem when with character display with sqlplus and even worst on TOAD, SQL Developer tool.
    there is a Heterogeneous connection between 11g and ms sql serever. i use freedts, unixodbc and dg4odbc to establish the connection.
    using isql tool...the select statement was well formatted..see sample |
    | Ventes USIM |
    | Resprise de charge provisionnees sur creance BUT when i use sqlplus some character are shattered..please see sample
    COST_NAME
    V e n t e s U S I M
    R e s p r i s e d e     c h a r g e p r o v i s i o n n e e s s u r c r e
    a n c ein other client tool e.g TOAD the output is worse just show only the first character of each row e.g V
    i have tried french and english value for nls_language but did not solve the problem.
    anybody with a clue of what is wrong...thanks

    It looks like some wrong character set conversion (more exactly -- lack of it) involving UTF-16 from MS SQL Server NVARCHAR data type. I cannot tell what went wrong and if this is a bug as I do not have experience with this configuration. Please, work with Oracle Support to diagnose and fix this issue.
    -- Sergiusz

  • Non-Latin Character Display On Web Page

    In a Java web application, only one non-Latin character display issue is that when they are typied into a JSP file. Otherwise, non-Latin characters display correctly from the message property file or from database.
    Anyone know how to solve it?
    Thanks.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Solved!
    Just need to have the JSP page tag on the related JSP file.
    null

    Welcome to our community, Denise
    Perhaps check the names of all the files involved? What type
    of web server are you using?
    You say that your co-worker said she is linking to the skin
    file from a .htm page, but what is missing here is whether she is
    using the .HTM page you provided in the mix or if it's one she
    created herself. If it's one she created herself, that may be the
    issue.
    Cheers... Rick

  • 'FTP_R3_TO_SERVER'  Chinese Character display as u2018#u2019

    I want to upload a *.txt which was saved as unicode .
    I use the following code to upload file to FTP server:
    call function 'FTP_R3_TO_SERVER'
      exporting
         handle = p_handle
         fname = p_filename
         character_mode = 'X'
      tables
         text = i_file
      exceptions
         tcpip_error = 1
         command_error = 2
         data_error = 3
        others = 4.
    But after upload, I find all Chinese Character display as u2018#u2019. 
    By the way, I use ECC6.0 to do development.
    How can I let the Chinese display correctly?

    Hi
    Try the following:
    1) Changes in the GUI settings. for this:
    a) go to SAP LOGON PAD.
    b) select your server -> change item.
    c) Go to Advanced.
    d) On the next screen the default selection under the section u2018Encoding for up- and download is u2018Default- ANSI u2013for Unicode Systemsu2019
    e) Please change this to u2018Default- UTF8 u2013for Unicode Systemsu2019
    f) Click on OK and save. Then logout from the system if you were already logged in. The login again for settings to take effect.
    Hope it'll help you.
    Regards
    Rishika bawa

  • Saving a character displayed on JPanel as an image

    Hi,
    Merry christmas!
    I am new to Java programming. Please englighten me with the following problem I am facing currently.
    I have been trying to save a chinese character displayed on a JPanel as an image. However, what I do not understand is that when the image is saved, it only captured the JPanel (and its background) instead of the character displayed on it.
    The following is my codes for this problem:
    static String strUTF16 = null;
    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {                                        
    File f = new File("c:\\"+ jTextField2.getText()+ ".JPEG");
    jPanel1.setVisible(true);
    Image capture = jPanel4.createImage(jPanel4.getWidth(),jPanel4.getHeight());
         Graphics g = capture.getGraphics();
    jPanel4.paint(g);
    if(jTextField2.getText() != null)
    try {
                   FileOutputStream out = new FileOutputStream(f);
                   BufferedImage image = null;
                   image = (BufferedImage)capture;
                   if (image != null) {
                        JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
                        JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(image);
                        param.setQuality(0.5f,true);
                        encoder.encode(image, param);
                        out.flush();
                        out.close();
              } catch (IOException e) {
                   System.out.println("Error, file cannot be written!\n");
    Any kind advices are greatly appreciated.
    Thanks!
    Shoker

    If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
    And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the code retains its original formatting.

  • Chinese Character display issue on Coldfusion 10

    My Company using Coldfusion to built an report platform and recently I upgrade our Coldfusion 7MX with Windows Server 2003 to Coldfusion 10 Enterprise with Windosw Server 2008 R2.
    I copy the Code from the Old server to the new one, but I met the problem I couldn’t solve.
    We have a repost that can enter, modify and view our SRM that has Chinese Character display request. Chinese character was display without problem when the system in the old server. which look like following.
    once I move the code into the new server, I got the problem with Chinese Character as following.
    This report pulling the data from SQL2005 with Windows Server 2003 R2.
    Coldfusion code code was same and both version is access to the same database.
    I ran all of the update included to install the windows MUI for Chinese character into the new server,  but I still can't get the character display correctly.
    I can view the chinese character website without issue but only to display in the report.
    I contact with Microsoft tech support but they don't have an solution for me. please help.

    Install windows server language pack:  http://www.microsoft.com/en-us/download/details.aspx?id=12250
    Are you sure the Chinese is encoded in UTF-8?  (It should be, but you should check the database field type encoding.)  If it's simplified chinese it could be set to GB18030 and if it's traditional chinese it could be Big5.
    You might want to leave off the encoding directive in CF and load the page in a browser then change encodings using tools > encodings  to see what works.
    祝你好运!

  • OO4 character Display Problem

    Hi All,
    I am using Oracle OLE objects to connect to Oracle 9.2 DB
    The NLS Language for the Database is AMERICAN_AMERICA.AR8ISO8859P6
    the client is using also the same NLS.
    When I retrive the information using OO4 some varchar2(Arabic Language) are return incorrectly from the DB, however when I use ADO on the same clinet it's correctly retrive all Data.
    I've only on home at my PC, and its NLS language is correct, even when I use SQL*Pluse the characters are displayed correctly.
    I also retrieved the NLS_LANG from the application using "SELECT USERENV ('LANGUAGE') FROM DUAL"
    and it was correct using ADO and OO4.
    Of course I've checked the registry value NLS_LANG and it's also AMERICAN_AMERICA.AR8ISO8859P6
    Any Help????

    I think after all it is a problem with the either:
    a. OS installer, which should really try to delete fonts which are duplicated by new system fonts
    b. OS which should give precedence to new system fonts over old system fonts where there are two the same, especially when the system fonts are in /System/Library/Fonts and the old ones are in /Library/Fonts
    The major annoyance is that this problem appeared with Leopard and took me hours of searching to figure out its origin - when you don't know if it is a character entry problem (which I thought) or a character display problem (which it turned out to be). In the end the fix was simple - delete the superceded fonts.

  • Character display problem latin characters

    For some reason old fonts show latin characters when i type "o/" and "l/". The problem seems confined to old fonts (at least Geneva; Monaco; New York), so I guess it is a bug?

    I think after all it is a problem with the either:
    a. OS installer, which should really try to delete fonts which are duplicated by new system fonts
    b. OS which should give precedence to new system fonts over old system fonts where there are two the same, especially when the system fonts are in /System/Library/Fonts and the old ones are in /Library/Fonts
    The major annoyance is that this problem appeared with Leopard and took me hours of searching to figure out its origin - when you don't know if it is a character entry problem (which I thought) or a character display problem (which it turned out to be). In the end the fix was simple - delete the superceded fonts.

  • Character display problem

    Hi All,
    When ever capital 'w' (i.e W, plain,Dialog and size 11) is first character in a text field left upper portion is not visible.But if I change any of these properties( i.e plain,Dialog, size 12) there is no problem.
    Can any body suggest me how can I display 'W' correctly with these propeties(i.e W, plain,Dialog and size 11).
    Thanks in advance

    I think after all it is a problem with the either:
    a. OS installer, which should really try to delete fonts which are duplicated by new system fonts
    b. OS which should give precedence to new system fonts over old system fonts where there are two the same, especially when the system fonts are in /System/Library/Fonts and the old ones are in /Library/Fonts
    The major annoyance is that this problem appeared with Leopard and took me hours of searching to figure out its origin - when you don't know if it is a character entry problem (which I thought) or a character display problem (which it turned out to be). In the end the fix was simple - delete the superceded fonts.

  • Character Display in old application

    Hi there,
    I am continuing updates on a VB6 program MyReels: at http://www.ozemail.com.au/~lmstearn.
    It runs surprisingly well under Windows 8.1 for XPSP3 compatibility.
    Unfortunately, there are now problems with character display that weren't seen in Win 8.0 or prior.
    For example
    Ellipsis "…" now displays as
    ligature "æ" now displays as
    (The two vertical lines on the right in the images can be ignored.)
    Is there some kind of compatibility patch I can use to correct this?
    Thanks for your interest!
    A natural, B flat, C sharp, D compile

    Hi,
    This issue can be caused by encoding or compatibility issue.
    Please check the similar issue in this thread:
    http://stackoverflow.com/questions/5882014/why-does-internet-explorer-9-show-weird-characters-on-utf8-and-whitespace-conten
    Please Note: Since the website is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.
    If your issue wasn't resolved, I suggest you submit new case on MSDN VB development support.
    http://social.msdn.microsoft.com/Forums/en-US/home?forum=vbgeneral
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.  Thank you for your understanding.
    Kate Li
    TechNet Community Support

  • Character display issue in French Web index tab

    First of all, I'm working with RoboHelp 8.
    There is a character display issue in the index tab of the web help. (See screenshot below)
    The apostrophe, instead of displaying by itself, it has a backslash just before it: \'
    In the hhk file, I started using the actual apostrophe ('), then replaced it with &#39; and finally tried &apos;
    (The htm files use utf-8 encoding). None of those options seemed to solve the issue.
    Any help will be appreciated.

    Hi Steve,
    Thanks for a very quick response. The problem is that the Title (name of the image filename is also the item number in Quote) and this is always not null. I am not sure how do I test whether the image is present in $OA_MEDIA directory or not. Does BI Publisher provide a way to find out whether an image filename exists in $OA_MEDIA or not.
    If there is no such standard way provided by BI Publsher, then I guess I will have to write Java function that executes in the middle tier and returns whether file exists with that name in $OA_MEDIA.
    Please let me know your view.
    Thanks

  • Wrong character display on certain website

    Wrong character display on certain website
    On certain website like this or engadget i see all the character in a wrong way.
    I got the same problem on 2 different computer.
    The addons that i've installed are: FIREBUG, ADBLOCK, Java console.
    Any idea on how to fix this?
    Thank yoy in advance.
    Here a screen shot of what i see:
    http://img686.imageshack.us/img686/4527/wrongs.jpg
    == URL of affected sites ==
    http://

    This issue can be caused by the bitmap version of the Helvetica or Geneva font or another (bitmap) font that can't be displayed by Firefox in that font size.
    Firefox can't display that font in the specified size and displays gibberish instead.
    You can test that by zooming out (View > Zoom > Zoom Out, Ctrl -) to make the text smaller.
    Uninstall (remove) all variants of that not working font to make Firefox use another font or find a True type version of that font that doesn't have the problem.
    See http://kb.mozillazine.org/Issues_related_to_fonts#Gibberish
    See also [/forum/1/566006]

  • Unicode Character A722 displays as a box with "A722" inside within tye Zotero pane on my laptop, but the character displays fine on my desktop.

    Both machines are running windows 7, Zotero 3.0.13, and Firefox 18.0.2. I cannot find any settings that are different, so I'm not sure why this character displays properly on one machine and not the other. The character is U+A722 = Ꜣ

    Try to disable hardware acceleration in Firefox.
    *Tools > Options > Advanced > General > Browsing: "Use hardware acceleration when available"
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    *https://hacks.mozilla.org/2010/09/hardware-acceleration/
    Try to set the gfx.content.azure.enabled pref to false or if this didn't help disable Direct2D by setting the gfx.direct2d.disabled pref to true on the about:config page and leave hardware acceleration otherwise enabled.
    *http://kb.mozillazine.org/about:config

  • Captivate 5 - Variable character display limitation?

    When displaying any Variable result, I am encountering a 15 character display limitation.  Is this a system limitation? If so, does a method to expand beyond 15 characters exist?  If not a system forced limitation - how do you expand the number of characters that are displayed when using Variable returns?
    I am using a User Variable named EMAIL - the entry can be somewhat lengthy.  The return is consistently cut off at 15 characters.
    Any thoughts are appreciated!

    Now I'm puzzled? What do you mean by 'Text Box'? To display a variable, that has acquired a value either by default (when defining the variable), or by using a Text Entry Box (associated with that variable) or by advanced actions, you need to create a Text Caption and insert the variable in that Text Caption.
    Could you please explain 'I forgot I had to use a Text Box to display a variable(and be able to manipulate it), not a Text Caption.' ?

  • Non-english character display as square box

    Hi all,
    I'm not very sure if this question should be asked here or in the JRE board, thus I'm trying here also
    I have been trying an opensourced application called Alliancep2p (could be obtained from www.alliancep2p.com) using JRE 1.6 on an English Windows XP Pro machine.
    The problem:
    all chinese input are displayed as "square box". It looks like the programme "gets" the correct character, only that everything is displayed as "square box".
    It looks like a font issue, though I'm not that sure. Is there anyway the default fonts could be changed, or to get the characters correctly displayed?
    Note: I have east asian fonts installed, and the Java config panel can display chinese or other non-english characters correctly.
    I tried the same application under GNU/Linux (locale is UTF-8) and chinese input/display correctly without any problem at all. Does it mean that it is not the problem of the application, or?
    The original question in the JRE board:
    http://forum.java.sun.com/thread.jspa?threadID=5265369&tstart=0
    Thanks for all the input.

    I'm not really sure if it's a problem of the application or not. But the fact that it works perfectly under Linux makes me think maybe it's not the problem of the program, and actually their developers said that unicode is being used all over the program and seems like they're not CJK users also.
    I'm not a java guru so I can't really tell from the source if there's anything wrong.

  • Special character displaying as ? in PDF output

    Hi,
    I am generating BI publisher report through Oracle application.
    My Pdf output is ok for Finnish and German language. But for polish font I am getting ? in PDF output. When I open XML file it says
    " The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    An invalid character was found in text content. Error processing resource"
    In database Polish font is stored perfectly.
    I tried this <?xml version="1.0" encoding="UTF-8" ?> for generating XML. But I did not work.
    I do not know what is the problem. Please help me.
    Regards,
    Faiyaz

    create or edit xdo.cfg file.
    For XML Publisher Desktop it is ( in my case) c:\Program Files\Oracle\XML Publisher Desktop\Template Builder for Word\config\.
    Find section fonts, add your font, that support polish. like that
    <font family="Times New Roman" style="normal" weight="normal">
    <truetype path="C:\WINDOWS\Fonts\times.ttf" />
    </font>
    For XML publisher is Note:399518.1. I think it can help you.

Maybe you are looking for