How to convert ascii value into character and vice versa

Hello the java world people,
I want to convert each characters from my array into their corespondent ascii value and vice versa, how can I do that ?

The term "ASCII" is often used very loosely.
Java char values are UNICODE and the ASCII codes are indentical to UNICODE characters in the range 0 .. 127. UNICODE values 128 and above don't have coresponding ASCII values, though 128-255 corespond to ISO-8859-1 which is one of the encodings often called "extended ASCII".
As shown above you can covert between chars and coresponding int value simply with a cast, but you should be aware that the more exotic characters will not give you sensible values.

Similar Messages

  • How to convert XML doc to string and vice versa?

    Assume I have a XML doc and I want to convert it into a string (and put it into a string variable).
    How can I do this?
    How can I do the opposite: Convert a string content into a XML doc?
    Peter

    Use:
    ParseEscapedXML() and ora:getContentAsString()
    See
    http://www.codeguru.com/cpp/sample_chapter/article.php/c10789__7/
    Marc

  • Object Creation Of One class into another and vice versa

    Hello Everyone,
    My name is Prashant Sharma from Jaipur [Rajasthan]
    Can u people help me
    How to create of one class into another and vice versa
    Eg,
    I am having class A and class B
    I want to create object of class A into class B and vice versa
    Plz help me out of this problem as soon as possible....

    Read this: [Creating Objects|http://java.sun.com/docs/books/tutorial/java/javaOO/objectcreation.html]
    Then, do one of these three:
    1. Create an instance of the class
    2. Extend the class
    3. Access methods within the class
    Try it out. Post the problem code if you're having trouble.

  • In the final display list how can i change rows to columns and vice versa

    in the final display list how can i change rows to columns and vice versa
    It's Urgent
    Thanks
    Basu

    Hai,
    Check this following Threads,
    converting rows to columns in internal tables
    Re: logic- report to move columns to row in a list
    Regards,
    Padmam.

  • Problem in converting ASCII value in Dev. and Production

    Hi...
    The ASCII values for # differ in the development and the production system.
    The code below (value 0009 ) populates # in the variable lv_sep.
    DATA: lv_sep TYPE x.
    FIELD-SYMBOLS : <field> TYPE x.
    ASSIGN lv_sep TO <field> CASTING TYPE x.
    <field> = 0009.
    The the development # = 0009 and in production # = 1000.
    Need to know why is this happening.

    How do you get the XML document? Do you use XSU? You can use:
    String str = qry.getXMLString();
    to get the result XML document in String.
    XSU will escape all of the < and >. Or the the XML document in
    one of the column will make the result XML doc not well-formed.
    Not quite understand your problem. You can send me your test
    case.
    i have an application that needs to send an XML document
    over the wire. For this reason, I need to convert the
    doc into a String at the sending side and back to Doc
    at the receiving side. This document is stored in a "CLOB"
    column in a table in the database. I use XDK to retrieve
    this entire row (including the CLOB - hence this is an XML
    document which has a column that itself is an xml document in
    string format - this is just the clob read in by XDK).
    Thus the row looks like
    <ROWSET>
    <ROW>
    <col1> A <col1>
    <CLOB_COL> ..clob value of an xml doc..</CLOB_COL>
    </ROW>
    </ROWSET>
    When I convert this document into String and back, one of the "<"
    tags in the clob column document gets changed to "<" and hence
    the parsing fails! I have used the latest label of the XDK build
    to get the latest parser jar but still i have the same problem.
    I am using the following routines for the conversion.
    /* for converting document to string */
    public static String convertToString(XMLDocument xml) throws
    IOException
    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    xml.print(pw);
    String result = sw.toString();
    return result;
    /* for converting string to document */
    public static XMLDocument convertToXml(String xmlStr)
    throws
    IOException,SAXException
    ByteArrayInputStream inStream = new
    ByteArrayInputStream(xmlStr.getBytes());
    DOMParser parser = new DOMParser();
    parser.setPreserveWhitespace(false);
    parser.parse(inStream);
    return parser.getDocument();

  • IPhone SDK: How to convert Pixel values into Point values

    UIScrollView has a property called contentSize. This takes values in points. How do i convert Pixel values into Point Vales?
    -TRS

    As far as I can tell, they're the same - I know they are in Photoshop at least. My 57x57 point Tab Bar icon is also 57x57 pixels.
    Hope that helps

  • Strange problem in converting between XML to string and vice versa

    i have an application that needs to send an XML document
    over the wire. For this reason, I need to convert the
    doc into a String at the sending side and back to Doc
    at the receiving side. This document is stored in a "CLOB"
    column in a table in the database. I use XDK to retrieve
    this entire row (including the CLOB - hence this is an XML
    document which has a column that itself is an xml document in
    string format - this is just the clob read in by XDK).
    Thus the row looks like
    <ROWSET>
    <ROW>
    <col1> A <col1>
    <CLOB_COL> ..clob value of an xml doc..</CLOB_COL>
    </ROW>
    </ROWSET>
    When I convert this document into String and back, one of the "<"
    tags in the clob column document gets changed to "&lt;" and hence
    the parsing fails! I have used the latest label of the XDK build
    to get the latest parser jar but still i have the same problem.
    I am using the following routines for the conversion.
    /* for converting document to string */
    public static String convertToString(XMLDocument xml) throws
    IOException
    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    xml.print(pw);
    String result = sw.toString();
    return result;
    /* for converting string to document */
    public static XMLDocument convertToXml(String xmlStr)
    throws
    IOException,SAXException
    ByteArrayInputStream inStream = new
    ByteArrayInputStream(xmlStr.getBytes());
    DOMParser parser = new DOMParser();
    parser.setPreserveWhitespace(false);
    parser.parse(inStream);
    return parser.getDocument();

    How do you get the XML document? Do you use XSU? You can use:
    String str = qry.getXMLString();
    to get the result XML document in String.
    XSU will escape all of the < and >. Or the the XML document in
    one of the column will make the result XML doc not well-formed.
    Not quite understand your problem. You can send me your test
    case.
    i have an application that needs to send an XML document
    over the wire. For this reason, I need to convert the
    doc into a String at the sending side and back to Doc
    at the receiving side. This document is stored in a "CLOB"
    column in a table in the database. I use XDK to retrieve
    this entire row (including the CLOB - hence this is an XML
    document which has a column that itself is an xml document in
    string format - this is just the clob read in by XDK).
    Thus the row looks like
    <ROWSET>
    <ROW>
    <col1> A <col1>
    <CLOB_COL> ..clob value of an xml doc..</CLOB_COL>
    </ROW>
    </ROWSET>
    When I convert this document into String and back, one of the "<"
    tags in the clob column document gets changed to "<" and hence
    the parsing fails! I have used the latest label of the XDK build
    to get the latest parser jar but still i have the same problem.
    I am using the following routines for the conversion.
    /* for converting document to string */
    public static String convertToString(XMLDocument xml) throws
    IOException
    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    xml.print(pw);
    String result = sw.toString();
    return result;
    /* for converting string to document */
    public static XMLDocument convertToXml(String xmlStr)
    throws
    IOException,SAXException
    ByteArrayInputStream inStream = new
    ByteArrayInputStream(xmlStr.getBytes());
    DOMParser parser = new DOMParser();
    parser.setPreserveWhitespace(false);
    parser.parse(inStream);
    return parser.getDocument();

  • How to Change  Numeric Value into Character Value in Reports at run-time?

    Hi,
    I am creating some reports, in which i am facing a problem.
    i have an AMOUNT field of "NUMBER" data type in a table, I want to show the AMOUNT value in Character at run-rime.
    For example, if AMOUNT is 12000 then it should be converted into Character like "Twelve Thosand".
    Please help me to make it clear.
    Thanking you in advance.

    u can get decimal points through this function
    FUNCTION amt_2_word(amt varchar2) RETURN Char IS
    BEGIN
         declare
              --TYPE v_arr IS VARRAY(6) of varchar2(3);
              len number;
              i number;
              t_amt varchar2(100);
              t_word varchar2(20000);
              last_3rd varchar2(1);
              main varchar2(1000); -- number in format main.sub
              --v_main v_arr := v_arr('00','0','00','00','000');
              v_main1 varchar2(3) := '00';
              v_main2 varchar2(3) := '0';
              v_main3 varchar2(3) := '00';
              v_main4 varchar2(3) := '00';
              v_main5 varchar2(3) := '000';
              sub varchar2(1000);
              res_1 varchar2(32000);
              res_2 varchar2(32000);
              res_3 varchar2(32000);
              res_4 varchar2(32000);
              res_5 varchar2(32000);
              res varchar2(32000);
         begin
              t_amt := lpad(amt, 10, '0');
              len := length(amt);
              i := instr(amt, '.');
              if i = 0 then
                   main := lpad(amt, 10, '0');
                   sub := '';
              else
                   main := lpad(left(amt, instr(amt, '.')-1), 10, '0');
                   sub := rpad(right(amt, len - instr(amt, '.')), 2, '0');
              end if;
              v_main1 := right(main, 2);
              v_main2 := left(right(main, 3), 1);
              v_main3 := left(right(main, 5), 2);
              v_main4 := left(right(main, 7), 2);
              v_main5 := left(main, 3);
              if v_main1 <> '00' then
                   res_1 :=getTwo(v_main1);
              end if;
              if v_main2 <> '0' then
                   res_2 := getOne(v_main2) || ' Hundred ';
              end if;
              if v_main3 <> '00' then
                   res_3 := getTwo(v_main3) || ' Thousand ';
              end if;
              if v_main4 <> '00' then
                   res_4 := getTwo(v_main4) || ' Lac ';
              end if;
              if v_main5 <> '000' then
                   last_3rd := left(right(v_main5, 3), 1);
                   if last_3rd <> '0' then
                        res_5 := getOne(last_3rd) || ' Hundred ';
                   end if;
                   res_5 := res_5 || getTwo(right(v_main5, 2)) || ' Crore ';
              end if;
              res := 'Rupees ' || res_5 || res_4 || res_3 || res_2 || res_1 || ' ';
              if sub is null then
                   res := res || 'Only';
              else
                   res_1 := getTwo(sub);
                   res := res || 'and Paise ' || res_1 || ' Only';
              end if;
              return res;
         end;
    END;
    u write this PL SQL in ur databse and u can use this function and get amount to word

  • How to convert excel data into OTF and FAX

    Hi All,
    We have a requirement where in we have a smartform output (OTF data) converted into PDF, and an excel sheet, both being sent as email attachments.
    Now, we need to send the content of both the attachments as FAX.
    Since smartform output was OTF convertible, FAX was being sent using 'CONVERT_OTF_AND_FAX' FM.
    Can you let me know, if there is a possible way for manipulating the data that is converted to EXCEL, as OTF, and then FAX it?
    Or else, please suggest me an alternative way to FAX normal data (other than using 'CONVERT_OTF_AND_FAX').
    Thanks in advance,
    RAVI

    Hi All,
    We have a requirement where in we have a smartform output (OTF data) converted into PDF, and an excel sheet, both being sent as email attachments.
    Now, we need to send the content of both the attachments as FAX.
    Since smartform output was OTF convertible, FAX was being sent using 'CONVERT_OTF_AND_FAX' FM.
    Can you let me know, if there is a possible way for manipulating the data that is converted to EXCEL, as OTF, and then FAX it?
    Or else, please suggest me an alternative way to FAX normal data (other than using 'CONVERT_OTF_AND_FAX').
    Thanks in advance,
    RAVI

  • How to convert color tiff into black and white?

    Hey guys, am new to JAI and need to convert a color tiff into black and white, I've gone through google and developed following code.
    img = JAI.create("fileload","C:/eosimias.tif");
                   newColorModel = new ComponentColorModel(ColorSpace.getInstance(ColorSpace.CS_GRAY),new int[] {8},
                             false, false, Transparency.OPAQUE, DataBuffer.TYPE_BYTE);
                   pb = new ParameterBlock();
                   pb.addSource(img);
                   pb.add(newColorModel);
                   img2 = JAI.create("ColorConvert", pb);
    frame = new JFrame("Tiff study");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.add(new ScrollingImagePanel(img2, 400,400));
              frame.pack();
              frame.setVisible(true);When I execute the following program I get the following error
    java.lang.IllegalArgumentException: The specified ColorModel is incompatible with the image SampleModel.
    on the line frame.add(new ScrollingImagePanel(img2, 400,400));can someone please help me out with it.
    Thank you in advance.

    Check under Image> Mode and select 8 Bits / Channel  first.
    Cheers,
    Neale
    Insanity is hereditary, you get it from your children
    If this post or another user's post resolves the original issue, please mark the posts as correct and/or helpful accordingly. This helps other users with similar trouble get answers to their questions quicker. Thanks.

  • How 2 convert numeric value to character value?

    Hi friends,
    I want to convert numeric value to the character value.
    Is there any FM available?
    Points rewared soon.
    Regards
    Ronn

    REPORT ZSPELL.
    TABLES SPELL.
    DATA : T_SPELL LIKE SPELL OCCURS 0 WITH HEADER LINE.
    DATA : PAMOUNT LIKE SPELL-NUMBER  VALUE '1234510'.
    SY-TITLE = 'SPELLING NUMBER'.
    PERFORM SPELL_AMOUNT USING PAMOUNT 'USD'.
    WRITE: 'NUMBERS', T_SPELL-WORD, 'DECIMALS ', T_SPELL-DECWORD.
    FORM SPELL_AMOUNT USING PWRBTR PWAERS.
      CALL FUNCTION 'SPELL_AMOUNT'
           EXPORTING
                AMOUNT    = PAMOUNT
                CURRENCY  = PWAERS
                FILLER    = SPACE
                LANGUAGE  = 'E'
           IMPORTING
                IN_WORDS  = T_SPELL
           EXCEPTIONS
                NOT_FOUND = 1
                TOO_LARGE = 2
                OTHERS    = 3.
    ENDFORM.                               " SPELL_AMOUNT

  • How to convert ascii codes into Strings

    Is it possible to convert integers (ascii codes) into Strings. It cannot be done by casting like:
    int temp = (String)(111)
    Please help me out. I think there is a method for this.

    Something as simple as String.valueOf((char) 111) comes to mind...

  • Converting PC data to AppleWorks and vice versa

    Background: I am working with a high school reunion class administrator who has emailed me a mailing list file in a PC Excell spreadsheet format. I can read this in AppleWorks (6). He is asking me to put this in a database format where we can use this for mailing labels. He is asking me to send this back to him in MS Works format (He has PC MS Works not Mac MS Works) however he is using an Intel Mac preferring the Windows XP over OSX. I do not have MS Works only AppleWorks. Is all the above possible with AppleWorks? Can I put the data from the spreadsheet into a database format, and does that require I cut and paste everything? Once I get it into an AppleWorks database how do I put it into MS Works database format or something he can read into MS Works database format, and email it to him? First time experimenting with this and hope it will work out. Thanks in advance for any help. CAB
    Mac mini Intel/iBook G3   Mac OS X (10.4.5)   Mac OSX (10.3.5) for iBook

    My open question is how to take Excel data (.xls) and make a Apple Works database file? Must I cut and paste each name, address, phone #, email from Excel to Appleworks DB? Is there any other way?
    You should be able to copy and paste the entire data set in one move, provided you have an AppleWorks DB set up to receive the data.
    Create the AW DB, adding the fields in the same order as the columns of the Excel spreadsheet.
    Open the spreadsheet in Excel or as an AppleWorks spreadsheet.
    Select and copy all of the block of cells containing data.
    Click on the first (empty) record of the database document so the the whole record is highlighted (ie. click on the record, but not in a field, or in List view, click on the small square to the left of the first row), then Paste.
    Your data should be pasted in, creating one record in the DB for each line on the spreadsheet.
    Regards,
    Barry

  • How to convert a workbook into PDF and broadcast as Email attachment

    Hello Gurus,
    i have installed the ADS (Adobe Document services). I would like to broadcast workbooks as a pdf file to some user.
    When i open the workbook and go to Broadcast --> Setup a broadcast setting for this workbook. The distribution type is
    Broadcast E-mail; Broadcast E-mail (Bursting); Broadcast Portal; Broadcast Multichannel and Output Format only MS Workbook and Link to current Data. Here i miss the possibility as PDF.
    Where can i set up that the workbook should be broadcast as PDF.
    Any help appreciated.
    Thanks and kind rgerads,
    Murat

    Thanks all for your answers,
    i also read that with changing the format in Report designer then broadcasting via PDF. Is there no possibility for PDFs for MS Excel Workbooks? How does it work when opening the query in Report designer? What do i have to do there but it is no solution for us because in the workbooks we use GET BEX DATA formulas and just show parts of the analyisis grid. I need a proper solution how to use broadcaster converting workbooks into PDF an send them as email attachment
    Thanks,
    Murat

  • In BO 4.0,how to convert field values into column heading.

    Currently Product Codes are represented in "Code" and "Value" fields.
    Please retain the code and value fields, so that if the user adds another code and immediately needs to report on them they can through this functionality.
    Current:
    Fund Code
    Code
    Value
    ABC1
    Embassy Series
    XYZ123
    ABC1
    FMI
    19837
    ABC1
    Gladis Short Name
    FUJHAT
    Required:
    Fund Code
    Embassy Series
    FMI
    Gladis Short Name
    ABC1
    XYZ123
    19837
    FUJHAT

    Hi Archana,
    I think you need to use a Cross Tab on your report but also you will need to apply Sections on the Fund Code dimension.
    ie
    Section 1 - ABC1
    Crosstab
    Section 2 - ABC2
    Crosstab
    Section 3 - ABC3
    Crosstab
    With regards
    Gill

Maybe you are looking for

  • How do I sync my iPod to iTunes? I've used the final steps from Article HT1329, but when I open my iPod there is no "iTunes" folder.&#160; Please help!

    How do I sync my iPod to iTunes?  I've used the final steps from Article HT1329, but when I open my iPod there is no "iTunes" folder.  Please help!

  • One Mac g5 Two Hard Drives + Two Libraries.

    I have 2 hard drives with music on both. Id like to pull from both hard drives using only 1 iTunes Library on 1 Hard Drive with out transferring all music to 1 HD. Help?

  • Epson Utilities

    Ever since I switched to Leopard I have been having trouble with Epson Utilities. I have two Epson printers, R200 and an R1800. When I want to print on the R1800 and go into Epson Utilities to check ink levels Utilities crashes. However it works fine

  • Itunes frozen.

    I need some help guys. Just updated Itunes for the new 7.7 update and now Itunes freezes when I connect my touch. Tried to install a older version of itunes, but then it said some crap about the libary being to old or something like that. what is wro

  • Win7 32bit Flash videos won't play

    I have 2 PCs, both running Win7 Home Premium current with all patches as well as current versions of Chrome, IE9, and Firefox.   My 64bit desktop runs Flash videos just fine with all 3 browsers.  All was OK until the last day or two.  Now my 32bit la