Ascii Codes

Is there a function that can convert an ascii code to the proper character?
ie: in excel, one can use code() and char() to go back and forth.
Found some ref to \u0041 = A, but not sure if this is the right method?
Any assistance greatly appreciated.

Hi,
CODE("A") could be written in JavaScript as "A".charCodeAt(0), where the argument to charCodeAt is the position in the string so "AB".charCodeAt(1) would give you the code of B
and
CHAR(65) could be written in JavaScript as String.fromCharCode(65).  The method fromCharCode can take a list so String.fromCharCode(65,66,67) will return "ABC".
Bruce

Similar Messages

  • Convert char to ascii code and vice versa

    HI
    Is there any function module to convert char to ascii code and vice versa.
    Thanks in advance

    Hi,
    be careful if you have unicode running in your system. URL_ASCII_CODE_GET is platform-dependent so it will return the internal HERX representation of the character in your system - which is hopefully and in most cases ASCII.
    Under unicode, we use double-byte characters here. I tried this function and the result CHAR_CODE is '00' regardless what character I specify for TRANS_CHAR. But the coding is so simple I corrected resultig in this sample code:
    [P]
    convert p_form to ASCII (internal) representation
      DATA:
        l_ofs TYPE syfdpos,
        l_len TYPE sy-linsz,
        l_ascii TYPE i.
      FIELD-SYMBOLS:
        <x> TYPE x.
      l_len = STRLEN( p_ascii ).
      DO l_len TIMES.
        l_ofs = sy-index - 1.
        ASSIGN p_ascii+l_ofs(1) TO <x> CASTING.
        l_ascii = <x>.
        WRITE: l_ascii.
      ENDDO.
    [/P]
    Here, for each character of string p_ascii, the internal (ASCII) representation is determined and written to the output list.
    Regards,
    Clemens

  • How to send an attached file containing with non-ascii code ?

    Hi,
    I want to send a attaced text file containing with non-ascii code(Traditional Chinese). Is there any way to solve the encoding problem?
    Currently, it transfer into non-meaningful code in receiving side.
    Thanks for the help in advance.

    Here is the code:
    Session _gSession = null;
    MimeMessage message = null;
    Properties props = new Properties();
    props.put("mail.smtp.host", smtpHost);
    _gSession = javax.mail.Session.getInstance(props, null);
    message = new MimeMessage(_gSession);
    message.setFrom(new InternetAddress(emailSender , emailSender));
    InternetAddress ia[] = new InternetAddress[1];
    ia[0] = new InternetAddress(emailReceiver, emailReceiver);
    message.setRecipients(Message.RecipientType.TO, ia);
    message.setSubject("Test Encoding Attached File");
    message.saveChanges();
    BodyPart messageBodyPart = new MimeBodyPart();
    DataSource fds = new FileDataSource("Big5_Code.txt");
    messageBodyPart.setDataHandler(new DataHandler(fds));
    messageBodyPart.addHeader("Content-ID","meme");
    MimeMultipart multipart = new MimeMultipart("related");
    multipart.addBodyPart(messageBodyPart);
    message.setContent(multipart);
    transport.connect();
    transport.send(message);

  • How can I get the ASCII code instead of Unicode?

    If I use getNumericValue to return the Unicode of a character, I found out "a" = "A". Is there any way I can find out the different code for capital letter and small letter? I'm thinking about ASCII code, any suggestion for which method to return the ASCII code?

    That is not what getNumericValue does. (Try getNumericValue('*'), for example, and you will see it returns -1.) If you want to find the Unicode value of a character, simply cast the character to an int:char letter = 'A';
    int unicodeValue = (int)letter;If the character you chose was in the ASCII character set, you will automatically have its ASCII code, because ASCII is simply the first 128 characters in the Unicode character set.

  • Problem showing Trademark symbol using ascii code in Flex 3

    I am facing problem in displaying trademark symbol (™) using ascii codes(it is showing square symbol). I have ascii code stored in the database for trademark symbol(ascii code "&#153;" ). So I can't use Hexa code instead of ascii code. But using ascii code I am able to show copyright symbol. Following is the sample code :
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
        <mx:Script>
            var trademarkSymbol = "\u2122";
            var trademarkSymbol1 = "&#153;";
            var copyrightSymbol = "\u00A9";
            var copyrightSymbol1 = "&#169;";
        </mx:Script>
        <mx:Label text="Macromedia™"/>
        <mx:Label text="Macromedia{trademarkSymbol}"/>
        <mx:Label text="Macromedia{trademarkSymbol1}"/>      \\ problem  code
        <mx:Label text="Macromedia©"/>
        <mx:Label text="Macromedia{copyrightSymbol}"/>
        <mx:Label text="Macromedia{copyrightSymbol1}"/>
    </mx:Application>
    Please suggest some solution.
    Regards
    Rajat Sahni

    You must use Unicode values, not Windows extended ASCII values.
    The Unicode value of a copyright symbol is hex 00A9 or decimal 169. This happens to be the same as where it is in a Windows' extended ASCII character set, but this is irrelevant. The Unicode value of a copyright symbol is hex 2122 or decimal 8482. In Windows' extended ASCII it has a different value, hex 99 or decimal 153, but again this is irrelevant.
    So the reason you think it "works" for the copyright and not for the trademark is that the two character sets agree on the value of the copyright but disagree on the value of the trademark.
    Moral: Find a good Unicode table.
    Gordon Smith
    Adobe Flex SDK Team

  • ASCII Code in ABAP

    Hi Experts,
    We need to enter a unique ASCII character called 'US' or Unit Separator in a text file being generated through a program.
    The ASCII code for US is 31. However when we try and do it programmatically the character '#' is getting populated.
    The code is as follows:
    DATA : lv_sep type c.
    field-symbols : <xfs> type x.
    assign lv_sep to <xfs> casting.
    <xfs> = 0031.
    write lv_sep.
    Kindly help us out.
    Thanks and Regards,
    Ravi Bhatnagar

    Hi,
    This character is special one, so you can't print it out. In SAP all special charcter which can't be printed are replaced with placeholder #.  They are intended to do theri special purpose in flat file, once you open it.
    Do the following:
    - use fm HR_KR_XSTRING_TO_STRING to convert xstring with value  '1F' (30 decimal value) to string
    - write this string to certain place in internal string table (where you want later use it in the file)
    - download this table as to file
    - special character will do its purpose in text file
    This is the same functionality as you would be placing Line Feed (0x0A - 10 dec). It would be shown as # but once you open downlaoded file you don't see hash # anymore, but you see that new line in that place.
    Hope this is clear
    Regards
    Marcin

  • How do I get labview for linux to send out ascii code to a motion controller?

    I have posted part of this problem but I will now try to clearify things. I have an x-y stage that needs motion control. I have to run the motion controller from within a linux system (RedHat 7.1) due to others in the research area. I have found a motion controller card (PCI) that will run under linux. This card is not National Instruments. I understand that they do not have drivers for their controller cards. This other card comes with the companies own software that uses ASCII codes to move the motors on the stage. I was hoping to create a program that could call those ASCII codes to move the stage. An example would be if a user wanted to have the stage move to the right he would press a b
    utton on the screen instead of typing in whatever ASCII could that move to the right happens to be. How would I go about programming something like this? I have heard of others doing things like this but I am unsure of how to program labview to send out ASCII codes to a PCI card to move motors.

    > would I go about programming something like this? I have heard of
    > others doing things like this but I am unsure of how to program
    > labview to send out ASCII codes to a PCI card to move motors.
    Look in the manual to see get familiar with the sequences of codes you
    need to write, and more importantly, where you write them to. I suspect
    a memory location, but it could be a socket or port.
    Each of these locations will have a slightly different way of accessing
    it. Once you know, search devzone for how to do it on linux, or post
    back here.
    After you can send the codes to the right location, you probably want to
    build a state machine that simplifies the interface and prevents certain
    actions from taking place. Now determine which buttons or
    keys perform
    which actions and use either the event structure or the older polling
    for control changes to affect state changes in the state machine.
    I'm summarizing here assuming that you know what a state machine is and
    why you'd want to use it. If I'm assuming too much, do some research
    and post again with more specific questions. Also be sure to look at
    example VIs as they show how to respond to UI actions.
    Greg McKaskle

  • Unable to print ASCII codes

    Hello,
    I am facing a problem in printing ASCII code between 128 and 159. these codes are displayed as '?'. All the other codes are printed correctly. Please let me know the reason behind this.
    Given below is the code for the same
    class Codes
         public static void main(String args[])
              short i = 165;
              for (i=0; i<=256;i+=5)
                   System.out.println(i+" "+(byte)i+" "+(i+1)+" "+(byte)(i+1)+" "+(i+2)+" "+(byte)(i+2)+" "+(i+3)+" "+(byte)(i+3)+" "+(i+4)+" "+(byte)(i+4));
    Waiting for a quick reply
    rgds,
    Sameer

    1. What are the chars you are talking about? As already mentioned, they are control chars in unicode. What character encoding would you like to use, or in other words, what characters would you like to have for those bytes?
    2. The character encoding of the dos console (Cp850 on the windozes I've used) is different from the system's default encoding (Cp1252, IIRC). This will cause problems if you want to print out text having non-ascii characters. For example System.out.println("&Aring;&Auml;&Ouml;") should print out the last three letters of the finnish alphabet but it prints something else instead. But if you write the text to a file it comes out as it should.
    Another character encoding can be used by wrapping an OutputStreamWriter around System.out:
    OutputStreamWriter osw = new OutputStreamWriter(System.out, "Cp850");
    PrintWriter out = new PrintWriter(osw, true);
    out.println("&Aring;&Auml;&Ouml;");
    Similarly, the input read through the standard inputstream in dos (the keyboard input or redirection using "<") is in another encoding and needs to be converted.

  • ASCII code to print barcode on Lexmark printer

    Hi there
    Can anyone help me on how to arrive at ASCII code to produce EAN 128B barcode on Lexmark T634n laser printer? 
    TJ

    Hi Elini
    Sorry about the delay in getting back to you.
    I want to print the barcode from SAP Script.
    Please let me know if you need more information.
    Regards & Thanks
    Tripura

  • Getting ASCII code of a character in ABAP. How?

    Hi,
    i need use ascii codes in my program.
    I must get ascii code of a character. How can i get ascii code of a character?
    Thanks.

    Chk these links:
    http://www.sapdb.org/7.4/htmhelp/07/a16384a57411d2a97100a0c9449261/content.htm
    http://sap.ittoolbox.com/groups/technical-functional/sap-dev/function-to-get-ascii-code-234764

  • How can I convert characters into ascii code numbers ??

    Read the characters or String from keyboard input then I want the sum of the ascii code of the String or the characters. Please help ....
    Han

    Read the characters or String from keyboard input
    put then I want the sum of the ascii code of the
    String or the characters. Please help ....
    HanThe keyboard input part is a little more coding envolved. Here is a sample of what can be done if
    you know what to implement. It needs three classes
    from the java.io package. Well, here is the complete
    source code for the 'keyboard input' and a driver
    class to test it.
    //package consoleclass;
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    import java.io.IOException;
    class Driver
         public static void main ( String[] args)
              System.out.println("Enter a number");
              int number = MyInput.readInt();
              System.out.println("number entered "+ number);
              System.out.println("Enter another number");
              number = MyInput.readInt();
              System.out.println("number entered "+ number);
    class MyInput
      /**Read a string from the keyboard*/
      public static String readString()
         BufferedReader br
           = new BufferedReader(new InputStreamReader(System.in), 1);
         // Declare and initialize the string
         String string = " ";
         // Get the string from the keyboard
         try
           string = br.readLine();
         catch (IOException ex)
           System.out.println(ex);
         // Return the string obtained from the keyboard
         return string;
      /**Read an int value from the keyboard*/
      public static int readInt()
         return Integer.parseInt(readString());
      /**Read a double value from the keyboard*/
      public static double readDouble()
         return Double.parseDouble(readString());
    }

  • Saving characters with ASCII codes (128 - 256) into txt file problem

    Hello,
    I am saving a query results into a text file (test.txt) with this procedure:
    BEGIN
    OWA_UTIL.mime_header ('application/octet', FALSE);
    HTP.p ('Content-Disposition: attachment; filename="TEST.TXT"');
    OWA_UTIL.http_header_close;
    for rec in (select sample_text from tmp)
    loop
    htp.prn ( chr(230) || rec.sample_text || utl_tcp.crlf);
    end loop;
    -- Send an error code so that the rest of the HTML does not render
    HTMLDB_APPLICATION.g_unrecoverable_error := TRUE;
    END;
    How can I save characters with ascii codes from 128 - 256 into the output file? If I use chr() function, characters are missing in the output file.
    Platform: Apex 4.2 on apex.oracle.com

    Hi 1010398,
    Some thoughts:
    I assume you've counted the characters in the output and/or used a "hex" text editor so you KNOW these characters are not being written. Are they not written at all, or are blanks being substituted or are NULLs being substituted?
    I couldn't find much documentation on htp.prn. Though, one place I found
    htp.prn (cbuf IN VARCHAR2 CHARACTER SET ANY_CS DEFAULT NULL);Do you suppose it's affected by the character set used?
    Howard

  • How toi deal with ascii code in manipulating strings or chars!

    hi ! my functions shoud do the following
    i pass a char value like 'a' , 'b' ,'c'... and it sould return the next value to me ( a---> b , c----> d)
    i know that i shall use ascii code to resolve that so can anyone grant me the source code for that solution and help me ?

    What about 'z'?char after (char ch) {
        return (ch == 'z') ? 'a' : ch + 1;
    }Kind regards,
    Levi

  • Captivate 8 - ETX ASCII code in XML export - error

    Hi,
    When I create an XML Export from a course (Captivate 8)  and open the XML in Notepad ++, I see following strange ASCII-code (See the screenshot below).
    When I take a look at the text in my Captivate file. The text is properly formatted in the text caption. There are also no strange characters in the entire captivate file.
    The text in my Captivate file is clean (copied without any formatting or manually typed).
    So the ASCII code must me added while exporting to XML.
    I know that I can remove those ASCII signs with the find and replace function, but I would like to know the reason Captivate adds those code at the end of some text.
    All help is appreciated.
    Regards,
    W

    Hi,
    When I create an XML Export from a course (Captivate 8)  and open the XML in Notepad ++, I see following strange ASCII-code (See the screenshot below).
    When I take a look at the text in my Captivate file. The text is properly formatted in the text caption. There are also no strange characters in the entire captivate file.
    The text in my Captivate file is clean (copied without any formatting or manually typed).
    So the ASCII code must me added while exporting to XML.
    I know that I can remove those ASCII signs with the find and replace function, but I would like to know the reason Captivate adds those code at the end of some text.
    All help is appreciated.
    Regards,
    W

  • Extended Ascii Code in Swing

    Hi master,
    I have found some viewing extended ascii code in Swing. The palteform I used is Windows Me.
    It is not viewing properly for some of chars with ascii code more than 127 to 255.
    Any idea would be appreciate.
    Thanks in advance!

    Hi,
    This character is special one, so you can't print it out. In SAP all special charcter which can't be printed are replaced with placeholder #.  They are intended to do theri special purpose in flat file, once you open it.
    Do the following:
    - use fm HR_KR_XSTRING_TO_STRING to convert xstring with value  '1F' (30 decimal value) to string
    - write this string to certain place in internal string table (where you want later use it in the file)
    - download this table as to file
    - special character will do its purpose in text file
    This is the same functionality as you would be placing Line Feed (0x0A - 10 dec). It would be shown as # but once you open downlaoded file you don't see hash # anymore, but you see that new line in that place.
    Hope this is clear
    Regards
    Marcin

  • Ascii Code/Cycle

    Hello! I am a noob in programming, more particularly in Java and needed some help! How do i make a cycle to only stop when I make ctrl+z that is through ASCII code of ctrl+z? Thanks for your aswers
    ps: sorry for my english

    I'm assuming a windows platform where Ctrl-Z is end of file. On Unix platforms it would be Ctrl-D.
    Simply look for end of file condition. For example, with InputStream.read() you look for a -1 return value. For example:
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.IOException;
    import java.io.InputStream;
    public class EndOfFile {
        public static void main(String[] args) {
            File inputFile = new File("myFile.txt");
            InputStream in;
            int ch;
            try {
                in = new FileInputStream(inputFile);
                while ((ch = in.read()) != -1) {
                    // do something
                in.close();
            } catch (FileNotFoundException e) {
                System.err.println(e);
            } catch (IOException e) {
                System.err.println(e);
    }

Maybe you are looking for

  • I can't save files to desktop in OS 10.8.2

    is there some reason I can't seem to use the finder to select the desktop to save files to? 

  • How to format a text field for credit card numbers?

    OK, I found this conversation, http://forums.adobe.com/message/3598185, that gave some useful insight, and I adapted the code presented in it to make sure the user types in a 16-digit number, and it tells them to do it right if they don't. Here's my

  • Urgent! OIM database application Connector

    I am using 9.0.4 OIM connector pack. How can I make sure the database application is properly deployed and reconcilation is taking place? And also how do you make sure it is configured properly? Iam using SQL Server database.

  • Whatz Default UserID and Passwd for ODM and SSO

    Hi, I have installed oracle9i on win2k.After the installation,i tried to use the Oracle Directory Manager. I use the Default Userid "cn=orcladmin" and the Default passwd "welcome" to connect to OID server through oracle directory manager. It gives me

  • ISE and DCHP service in Endpoint

    Hi, If possible configure NAC/ISE for detect PC without dhcp activated?. Is possible forced the network adapter to dhcp?. Regards.