Binary/hex to ASCII character

I am trying to send 8bits to a microcontroller, who understands ASCII characters. I am having trouble finding out how to convert my 8bits, or hex values, to the corresponding ASCII character....
i.e. 01010101 binary = 55 hex = U char
See the attached file...
Attachments:
Bin2Hex.vi ‏64 KB

Graz, sorry i posted in the wrong forum at first, but thanks for replying.
I am able to check what the microcontroller recieves, by activating 8 LED's corresponding to the byte. When using the attached file: Basic Write 1, wverything works great. The LED's will represent the byte exactly, for example 01010101 when sending the string "U" and so on..
For my project i need to be able to specify 8 bits (or switches) individually, and send this to the microcontroller, in the manner of the attached file Bin2Hex...
I basically just need to combine these two in the correct manner... something im yet to achieve..
Attachments:
Basic Write 1.vi ‏40 KB
Bin2Hex.vi ‏56 KB

Similar Messages

  • How do I convert the ASCII character % which is 25h to a hex number. I've tried using the scan value VI but get a zero in the value field.

    How do I convert the ASCII character % ,which is 25h, to a hex number 25h. I've tried using the scan value VI but I get a zero in the value field. 

    You can use String to Byte Array for this.

  • Hex string conversion to ASCII Character string

    I have a Hex String 494A4B4C and want this string to get converted in ASCII Character String. IJKL. How to do in Labview 8.5.

    Here is a screenshot of the described code:
    Ton
    Message Edited by TCPlomp on 30-09-2009 01:35 PM
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!
    Attachments:
    Example_VI_BD.png ‏3 KB

  • Help with binary to decimal, binary to hex, and hex to ascii or ascii to hex program

    I decided to do a program that will do binary to decimal, binary to hex, and hex to ascii for a project related to a java programming course, which only needs to perform features from chapters 1-6 and 8 of Tony Gaddis's book. The functions work fine as their own main programs out side of this combined effort, so can anyone help me determine why I get the following 41 errrors saying: class, interface, or enum expected as well as any other errors that may show up afterwards because I'm stumped. My flowcharts, which have to be revised after discovering that my previous function were logically incorrect after running them in their own main are attached below as the spec sheet.
    My code is as follows and I hope you don't mind the commented lines of unused code because I'm not sure where I want things and what I want at the moment:
    import java.util.Scanner;
    import java.io.*;
    import java.lang.*;
    public class BintoDectoHextoAscii
       public static void main(String[] args)throws IOException
          Scanner input = new Scanner(System.in);
          System.out.println("Enter a binary number: ");
          String binary = input.nextLine(); // store input from user
         if (binary == input.nextLine())
          //int i= Integer.parseInt(hex,2);
          //String hexString = Integer.toHexString(i);
          //System.out.println("Hexa decimal: " + hexString);
          //int finaldecimalvalue = binaryToDecimal(hexString);
          int finaldecimalvalue = binaryToDecimal(hexString);
         if (binary != input.nextLine())
          String hexInput; // The variable Bin Input declared as the datatype int to store the Binary value  
          // Create a Scanner object for keyboard input.
          //Scanner keyboard = new Scanner(System.in);
          // Get the number of binary files.
          System.out.print("Enter the Hex value: ");
          hexInput = keyboard.nextLine();
          System.out.println("Original String: "+ hexInput);
          //String hexEquivalent = asciiToHex(demoString);
          String hexEquivalent = asciiToHex(hexInput);
          //Hex value of original String
          System.out.println("Hex String: "+ hexEquivalent);
          String asciiEquivalent = hexToASCII(hexEquivalent);
          //ASCII value obtained from Hex value
          System.out.println("Ascii String: "+ asciiEquivalent);String finalhexOutput = HextoAsciiConverter(hexEquivalent);
         if (binary != input.nextLine() && hexInput != keyboard.nextLine())
             BufferedReader binInput = new BufferedReader(new InputStreamReader(System.in));
             System.out.println("Enter the Binary number:");
             String hex = binInput.readLine();
             //String finaldecimalvalue = binaryToDecimal(decimal);
             //long finalhexvalue = BinaryToHexadecimal(num);
             long finalhexvalue = BinaryToHexadecimal();
       public static String BinaryToHexadecimal(String hex)
          //public static void main(String[] args)throws IOException
             //BufferedReader bf= new BufferedReader(new InputStreamReader(System.in));
             //System.out.println("Enter the Binary number:");
             //String hex = binInput.readLine();
             long num = Long.parseLong(hex);
             long rem;
             while(num > 0)
             rem = num % 10;
             num = num / 10;
             if(rem != 0 && rem != 1)
             System.out.println("This is not a binary number.");
             System.out.println("Please try once again.");
             System.exit(0);
             int i= Integer.parseInt(hex,2);
             String hexString = Integer.toHexString(i);
             System.out.println("Hexa decimal: " + hexString);
          return num.tolong();
      //int i= Integer.parseInt(hex,2);
      //String hexString = Integer.toHexString(i);
      //System.out.println("Hexa decimal: " + hexString);
    //} // end BintoDectoHextoAsciil
       //public static String HexAsciiConverter(String hextInput)
          // Get the number of binary files.
          //System.out.print("Enter the Hex value: ");
          //hexInput = keyboard.nextLine();
          //System.out.println("Original String: "+ hexInput);
          //String hexEquivalent = asciiToHex(demoString);
          //String hexEquivalent = asciiToHex(hexInput);
          //Hex value of original String
          //System.out.println("Hex String: "+ hexEquivalent);
          //String asciiEquivalent = hexToASCII(hexEquivalent);
          //ASCII value obtained from Hex value
          //System.out.println("Ascii String: "+ asciiEquivalent);
       //} // End function  
       private static String asciiToHex(String asciiValue)
          char[] chars = asciiValue.toCharArray();
          StringBuffer hex = new StringBuffer();
          for (int i = 0; i < chars.length; i++)
             hex.append(Integer.toHexString((int) chars[i]));
          return hex.toString();
       private static String hexToASCII(String hexValue)
          StringBuilder output = new StringBuilder("");
          for (int i = 0; i < hexValue.length(); i += 2)
             String str = hexValue.substring(i, i + 2);
             output.append((char) Integer.parseInt(str, 16));
          return output.toString();
       public static String binaryToDecimal(String binary)
            //Scanner input = new Scanner(System.in);
            //System.out.println("Enter a binary number: ");
            //String binary = input.nextLine(); // store input from user
            int[] powers = new int[16]; // contains powers of 2
            int powersIndex = 0; // keep track of the index
            int decimal = 0; // will contain decimals
            boolean isCorrect = true; // flag if incorrect input
           // populate the powers array with powers of 2
            for(int i = 0; i < powers.length; i++)
                powers[i] = (int) Math.pow(2, i);
            for(int i = binary.length() - 1; i >= 0; i--)
                // if 1 add to decimal to calculate
                if(binary.charAt(i) == '1')
                    decimal = decimal + powers[powersIndex]; // calc the decimal
                else if(binary.charAt(i) != '0' & binary.charAt(i) != '1')
                    isCorrect = false; // flag the wrong input
                    break; // break from loop due to wrong input
                } // end else if
                // keeps track of which power we are on
                powersIndex++; // counts from zero up to combat the loop counting down to zero
            } // end for
            if(isCorrect) // print decimal output
                System.out.println(binary + " converted to base 10 is: " + decimal);
            else // print incorrect input message
                System.out.println("Wrong input! It is binary... 0 and 1's like.....!");
            return decimal.toint();
       } // end function
    The errors are as follows:
    ----jGRASP exec: javac BintoDectoHextoAscii.java
    BintoDectoHextoAscii.java:65: error: class, interface, or enum expected
       public static String BinaryToHexadecimal(String hex)
                     ^
    BintoDectoHextoAscii.java:73: error: class, interface, or enum expected
             long rem;
             ^
    BintoDectoHextoAscii.java:74: error: class, interface, or enum expected
             while(num > 0)
             ^
    BintoDectoHextoAscii.java:77: error: class, interface, or enum expected
             num = num / 10;
             ^
    BintoDectoHextoAscii.java:78: error: class, interface, or enum expected
             if(rem != 0 && rem != 1)
             ^
    BintoDectoHextoAscii.java:81: error: class, interface, or enum expected
             System.out.println("Please try once again.");
             ^
    BintoDectoHextoAscii.java:83: error: class, interface, or enum expected
             System.exit(0);
             ^
    BintoDectoHextoAscii.java:84: error: class, interface, or enum expected
             ^
    BintoDectoHextoAscii.java:87: error: class, interface, or enum expected
             String hexString = Integer.toHexString(i);
             ^
    BintoDectoHextoAscii.java:88: error: class, interface, or enum expected
             System.out.println("Hexa decimal: " + hexString);
             ^
    BintoDectoHextoAscii.java:90: error: class, interface, or enum expected
          return num.tolong();
          ^
    BintoDectoHextoAscii.java:91: error: class, interface, or enum expected
       ^
    BintoDectoHextoAscii.java:124: error: class, interface, or enum expected
          StringBuffer hex = new StringBuffer();
          ^
    BintoDectoHextoAscii.java:125: error: class, interface, or enum expected
          for (int i = 0; i < chars.length; i++)
          ^
    BintoDectoHextoAscii.java:125: error: class, interface, or enum expected
          for (int i = 0; i < chars.length; i++)
                          ^
    BintoDectoHextoAscii.java:125: error: class, interface, or enum expected
          for (int i = 0; i < chars.length; i++)
                                            ^
    BintoDectoHextoAscii.java:128: error: class, interface, or enum expected
          ^
    BintoDectoHextoAscii.java:130: error: class, interface, or enum expected
       ^
    BintoDectoHextoAscii.java:135: error: class, interface, or enum expected
          for (int i = 0; i < hexValue.length(); i += 2)
          ^
    BintoDectoHextoAscii.java:135: error: class, interface, or enum expected
          for (int i = 0; i < hexValue.length(); i += 2)
                          ^
    BintoDectoHextoAscii.java:135: error: class, interface, or enum expected
          for (int i = 0; i < hexValue.length(); i += 2)
                                                 ^
    BintoDectoHextoAscii.java:138: error: class, interface, or enum expected
             output.append((char) Integer.parseInt(str, 16));
             ^
    BintoDectoHextoAscii.java:139: error: class, interface, or enum expected
          ^
    BintoDectoHextoAscii.java:141: error: class, interface, or enum expected
       ^
    BintoDectoHextoAscii.java:144: error: class, interface, or enum expected
       public static String binaryToDecimal(String binary)
                     ^
    BintoDectoHextoAscii.java:150: error: class, interface, or enum expected
            int powersIndex = 0; // keep track of the index
            ^
    BintoDectoHextoAscii.java:151: error: class, interface, or enum expected
            int decimal = 0; // will contain decimals
            ^
    BintoDectoHextoAscii.java:152: error: class, interface, or enum expected
            boolean isCorrect = true; // flag if incorrect input
            ^
    BintoDectoHextoAscii.java:155: error: class, interface, or enum expected
            for(int i = 0; i < powers.length; i++)
            ^
    BintoDectoHextoAscii.java:155: error: class, interface, or enum expected
            for(int i = 0; i < powers.length; i++)
                           ^
    BintoDectoHextoAscii.java:155: error: class, interface, or enum expected
            for(int i = 0; i < powers.length; i++)
                                              ^
    BintoDectoHextoAscii.java:159: error: class, interface, or enum expected
            for(int i = binary.length() - 1; i >= 0; i--)
            ^
    BintoDectoHextoAscii.java:159: error: class, interface, or enum expected
            for(int i = binary.length() - 1; i >= 0; i--)
                                             ^
    BintoDectoHextoAscii.java:159: error: class, interface, or enum expected
            for(int i = binary.length() - 1; i >= 0; i--)
                                                     ^
    BintoDectoHextoAscii.java:166: error: class, interface, or enum expected
                else if(binary.charAt(i) != '0' & binary.charAt(i) != '1')
                ^
    BintoDectoHextoAscii.java:169: error: class, interface, or enum expected
                    break; // break from loop due to wrong input
                    ^
    BintoDectoHextoAscii.java:170: error: class, interface, or enum expected
                } // end else if
                ^
    BintoDectoHextoAscii.java:174: error: class, interface, or enum expected
            } // end for
            ^
    BintoDectoHextoAscii.java:180: error: class, interface, or enum expected
            else // print incorrect input message
            ^
    BintoDectoHextoAscii.java:185: error: class, interface, or enum expected
            return decimal.toint();
            ^
    BintoDectoHextoAscii.java:186: error: class, interface, or enum expected
       } // end function
       ^
    41 errors
    ----jGRASP wedge2: exit code for process is 1.
    ----jGRASP: operation complete.

    so can anyone help me determine why I get the following 41 errrors saying: class, interface, or enum expected as well as any other errors that may show up afterwards because I'm stumped.
    Yes - YOU CAN!
    My code is as follows and I hope you don't mind the commented lines of unused code because I'm not sure where I want things and what I want at the moment:
    Excellent! Commenting out code is EXACTLY how you troubleshoot problems like yours.
    Comment out sections of code until the problem goes away. Then start adding back ONE SECTION of code at a time until the problem occurs. When it does you have just FOUND the problem.
    If you do that you wind up with code that looks like this:
    import java.util.Scanner;
    import java.io.*;
    import java.lang.*;
    public class BintoDectoHextoAscii  {
          public static void main(String[] args)throws IOException      {
             Scanner input = new Scanner(System.in);
             System.out.println("Enter a binary number: ");
             String binary = input.nextLine(); // store input from user
                  public static String BinaryToHexadecimal(String hex)     {     } // end function        
    Notice ANYTHING UNUSUAL?
    You have a complete CLASS definition followed by a method definition.
    Methods have to be INSIDE the class - you can NOT define methods on their own.
    Write modular code.
    Write EMPTY methods - just the method signature and maybe a RETURN NULL if you need to return something.
    Then add calls to those empty methods.
    When everything compiles and runs find you can start adding code to the methods ONE METHOD AT A TIME.
    Test compile and run after you add the code for each method.

  • Hex to ascii

    Now if i convert hex to ASCII and then back to HEX will the data be same.
    youll say yes.I know.this holds good if the data is char or string
    my question is what if double,int,float are converted to hex format and then converted to ASCII format and then back to hex format.
    will the data be same.HELP
    kudos welcome
    Solved!
    Go to Solution.

    Please explain what you mean, because there are many ways to go from numeric to string.
    The terms HEX and ASCII have no meaning unless you explain exactly what you are trying to do.
    If you take a numeric (DBL, I32, U8, CXT, etc), you can represent it as a string using typecast or flatten to string, and the information will be retained bit by bit. If you later unflatten or typecast it back, nothing is lost.
    Here, the resulting string is typically to readable, unless the string is displayed in hex format.
    If you talk about formatting, you might lose a lot of information irreversibly. You can only format integers to hex format. If you format a DBL to a decimal string representation, you need to ensure that you show enough decimal digits. Even if you do, there will be small differences due to the inability to fully represent certain fractions in the other numeric system (binary vs. decimal). A formatted string is typically readable directly.
    Please provide more information!
    LabVIEW Champion . Do more with less code and in less time .

  • Illegal ASCII character, 0xc3

    I have developed a webservice but I have a problem when certain characters get
    passed through. The error is as follows:-
    java.io.CharConversionException: Illegal ASCII character, 0xc3
    at weblogic.xml.babel.reader.XmlReader$AsciiReader.read(XmlReader.java:8
    24)
    at weblogic.xml.babel.scanner.ScannerState.read(ScannerState.java:382)
    at weblogic.xml.babel.scanner.ScannerState.expect(ScannerState.java:235)
    at weblogic.xml.babel.scanner.Reference.read(Reference.java:115)
    at weblogic.xml.babel.scanner.Scanner.startState(Scanner.java:262)
    at weblogic.xml.babel.scanner.Scanner.scan(Scanner.java:153)
    at weblogic.xml.babel.baseparser.BaseParser.accept(BaseParser.java:451)
    at weblogic.xml.babel.baseparser.CharDataElement.parse(CharDataElement.j
    ava:84)
    at weblogic.xml.babel.baseparser.BaseParser.parseElement(BaseParser.java
    :399)
    at weblogic.xml.babel.baseparser.BaseParser.parseSome(BaseParser.java:27
    8)
    at weblogic.xml.babel.parsers.XMLInputStreamParser.internalParseSome(XML
    InputStreamParser.java:120)
    at weblogic.xml.babel.parsers.XMLInputStreamParser.streamParseSome(XMLIn
    putStreamParser.java:135)
    at weblogic.xml.babel.stream.XMLInputStreamBase.peek(XMLInputStreamBase.
    java:203)
    at weblogic.xml.stream.util.XMLInputStreamFilterBase.hasNext(XMLInputStr
    eamFilterBase.java:55)
    at weblogic.webservice.xml.XMLNode.readChildren(XMLNode.java:714)
    at weblogic.webservice.xml.XMLNode.read(XMLNode.java:664)
    at weblogic.webservice.xml.XMLNode.readChildren(XMLNode.java:722)
    at weblogic.webservice.xml.XMLNode.read(XMLNode.java:664)
    at weblogic.webservice.xml.XMLNode.readChildren(XMLNode.java:722)
    at weblogic.webservice.xml.XMLNode.read(XMLNode.java:664)
    at weblogic.webservice.core.soap.SOAPEnvelopeImpl.<init>(SOAPEnvelopeImp
    l.java:166)
    at weblogic.webservice.core.soap.SOAPPartImpl.<init>(SOAPPartImpl.java:1
    04)
    at weblogic.webservice.core.soap.SOAPMessageImpl.<init>(SOAPMessageImpl.
    java:113)
    at weblogic.webservice.core.soap.MessageFactoryImpl.createMessage(Messag
    eFactoryImpl.java:27)
    at weblogic.webservice.binding.soap.HttpServerBinding.receive(HttpServer
    Binding.java:50)
    at weblogic.webservice.core.DefaultWebService.invoke(DefaultWebService.j
    ava:243)
    at weblogic.webservice.server.servlet.ServletBase.serverSideInvoke(Servl
    etBase.java:419)
    at weblogic.webservice.server.servlet.WebServiceServlet.serverSideInvoke
    (WebServiceServlet.java:277)
    at weblogic.webservice.server.servlet.ServletBase.doPost(ServletBase.jav
    a:403)
    at weblogic.webservice.server.servlet.WebServiceServlet.doPost(WebServic
    eServlet.java:245)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
    (ServletStubImpl.java:1075)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:418)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    Does anyone have any ideas. I did see a similar post which recommended setting
    the weblogic.webservice.i18n.charset="UTF-8" system property, however I already
    had this set and it makes no difference.
    Anyones help would be much appreciated.
    Cheers
    Andy

    Hi Andy,
    The weblogic.webservice.i18n.charset is valid for both WLS v7 & v8. The
    API using the BindingInfo class is for WLS v8.
    I've attached a simple method (there are many ways to do this) that you
    can call to print out the hex values in your stream to help troubleshoot
    the problem. If you could create a small reproducer for our support
    team, that would be a big help.
    Thanks,
    Bruce
    Andy Freeman wrote:
    >
    I am using WLS 7 sp2. I had already set the weblogic.webservice.i18n.charset system
    property, but this didn't make any difference, although I'm not sure that this
    is a valid feature of wls7.
    The docs you pointed out mention using the BindingInfo class on the client, but
    again I think this is wls8 class, and isn't included in wls7.
    Any further advice/assistence would be much appreciated.
    Cheers
    Andy
    Bruce Stephens <[email protected]> wrote:
    Hi Andy,
    The error text says it; the US-ASCII character is invalid. You might
    look over the information about character sets and encoding in the docs
    [1]. Did you try setting the weblogic.webservice.i18n.charset="UTF-8"
    property on the server side? Java character encoding is a one of the
    engineering wonders of the world :-)
    What version of WLS?
    Thanks,
    Bruce
    [1]
    http://edocs.bea.com/wls/docs81/webserv/i18n.html#1069146
    Andy Freeman wrote:
    I have developed a webservice but I have a problem when certain charactersget
    passed through. The error is as follows:-
    java.io.CharConversionException: Illegal ASCII character, 0xc3
    at weblogic.xml.babel.reader.XmlReader$AsciiReader.read(XmlReader.java:8
    24)
    at weblogic.xml.babel.scanner.ScannerState.read(ScannerState.java:382)
    at weblogic.xml.babel.scanner.ScannerState.expect(ScannerState.java:235)
    at weblogic.xml.babel.scanner.Reference.read(Reference.java:115)
    at weblogic.xml.babel.scanner.Scanner.startState(Scanner.java:262)
    at weblogic.xml.babel.scanner.Scanner.scan(Scanner.java:153)
    at weblogic.xml.babel.baseparser.BaseParser.accept(BaseParser.java:451)
    at weblogic.xml.babel.baseparser.CharDataElement.parse(CharDataElement.j
    ava:84)
    at weblogic.xml.babel.baseparser.BaseParser.parseElement(BaseParser.java
    :399)
    at weblogic.xml.babel.baseparser.BaseParser.parseSome(BaseParser.java:27
    8)
    at weblogic.xml.babel.parsers.XMLInputStreamParser.internalParseSome(XML
    InputStreamParser.java:120)
    at weblogic.xml.babel.parsers.XMLInputStreamParser.streamParseSome(XMLIn
    putStreamParser.java:135)
    at weblogic.xml.babel.stream.XMLInputStreamBase.peek(XMLInputStreamBase.
    java:203)
    at weblogic.xml.stream.util.XMLInputStreamFilterBase.hasNext(XMLInputStr
    eamFilterBase.java:55)
    at weblogic.webservice.xml.XMLNode.readChildren(XMLNode.java:714)
    at weblogic.webservice.xml.XMLNode.read(XMLNode.java:664)
    at weblogic.webservice.xml.XMLNode.readChildren(XMLNode.java:722)
    at weblogic.webservice.xml.XMLNode.read(XMLNode.java:664)
    at weblogic.webservice.xml.XMLNode.readChildren(XMLNode.java:722)
    at weblogic.webservice.xml.XMLNode.read(XMLNode.java:664)
    at weblogic.webservice.core.soap.SOAPEnvelopeImpl.<init>(SOAPEnvelopeImp
    l.java:166)
    at weblogic.webservice.core.soap.SOAPPartImpl.<init>(SOAPPartImpl.java:1
    04)
    at weblogic.webservice.core.soap.SOAPMessageImpl.<init>(SOAPMessageImpl.
    java:113)
    at weblogic.webservice.core.soap.MessageFactoryImpl.createMessage(Messag
    eFactoryImpl.java:27)
    at weblogic.webservice.binding.soap.HttpServerBinding.receive(HttpServer
    Binding.java:50)
    at weblogic.webservice.core.DefaultWebService.invoke(DefaultWebService.j
    ava:243)
    at weblogic.webservice.server.servlet.ServletBase.serverSideInvoke(Servl
    etBase.java:419)
    at weblogic.webservice.server.servlet.WebServiceServlet.serverSideInvoke
    (WebServiceServlet.java:277)
    at weblogic.webservice.server.servlet.ServletBase.doPost(ServletBase.jav
    a:403)
    at weblogic.webservice.server.servlet.WebServiceServlet.doPost(WebServic
    eServlet.java:245)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
    (ServletStubImpl.java:1075)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:418)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    Does anyone have any ideas. I did see a similar post which recommendedsetting
    the weblogic.webservice.i18n.charset="UTF-8" system property, howeverI already
    had this set and it makes no difference.
    Anyones help would be much appreciated.
    Cheers
    Andy
    [Hex.java]

  • Non-ASCII character in Email field

    Hi Guys,
    I am trying to enter non-english characters in Email field of user form, but OIM throws an error that "A non-Ascii character has been entered". I have also tried to turn off the AppFirewall Filter in xlConfig.xml file but no help. Is there any way thay I can enter non-Ascii characters in Email field?
    Regards,
    Rahul

    .oO(surfinIan)
    >I have a script that converts a ms word document to text
    then uploads that to a
    >blob field on a mysql db.
    > During the conversion some characters my not be
    recognised. When i then call
    >up the blob for display on the browser...those characters
    show up as unknown
    >characters with a ? or box. Is there a way to
    preg_replace those unknown
    >characters before displaying them.
    What about fixing the encoding problem instead? If chars get
    lost during
    such a transfer
    document->script->database->script->browser it's always
    an encoding problem somewhere down the road.
    The recommendation these days is to use UTF-8, which avoids
    most of
    these old problems. You just have to make sure that your
    documents are
    properly stored as UTF-8 in the database and delivered as
    such to the
    script and the browser, then you don't have to worry about
    special chars
    anymore.
    That's just the general idea. I can't be more specific, since
    I don't
    know your conversion script or the database structure.
    Micha

  • [Solved] no non-ASCII character input in rxvt-unicode

    Hello everyone,
    For some days now, I can't write any non-ASCII characters any more in rxvt-unicode and rxvt-unicode-patched. Unfortunately, downgrading the rxvt-unicode package doesn't seem to help. To have at least a temporary solution, I'd like to know at least which packages I could try to downgrade as well. Any ideas, anyone?
    greez,
    maxmin
    Last edited by Maximalminimalist (2011-03-12 13:12:26)

    When I try to type a non-ASCII-character I get nothing at all. This happens with my custom keyboard layout (modified programmer dvorak) and in some layouts I already tried (us: altgr-intl, ch, de and fr)
    When I paste a non-ASCII characters in rxvt-unicode I get
    maxmin ~ $ ?
    This happens only on my x86_64 desktop which is more up to date than my i686 laptop. (I'm afraid now to do any updates.)
    EDIT: I'm sorry, I don't know what you mean with locale settings. What do you mean with that?
    EDIT2: Maybe just typing locale in the terminal is what you mean:
    maxmin ~ $ locale
    locale: Cannot set LC_CTYPE to default locale: No such file or directory
    locale: Cannot set LC_MESSAGES to default locale: No such file or directory
    locale: Cannot set LC_ALL to default locale: No such file or directory
    LANG=en_US.utf8
    LC_CTYPE="en_US.utf8"
    LC_NUMERIC="en_US.utf8"
    LC_TIME="en_US.utf8"
    LC_COLLATE="en_US.utf8"
    LC_MONETARY="en_US.utf8"
    LC_MESSAGES="en_US.utf8"
    LC_PAPER="en_US.utf8"
    LC_NAME="en_US.utf8"
    LC_ADDRESS="en_US.utf8"
    LC_TELEPHONE="en_US.utf8"
    LC_MEASUREMENT="en_US.utf8"
    LC_IDENTIFICATION="en_US.utf8"
    LC_ALL=
    With other terminal emulators I get sometimes also nothing and sometimes right displayed but wrong interpreted character in vim. I didn't take notes while doing that but I'll try again if needed.
    Last edited by Maximalminimalist (2011-03-06 21:51:23)

  • ALV Grid bug when dealing with non-ASCII character

    Dear all,
    I have a requirement to display user's remarks on ALV.  The data element of the remarks column is TEXT200.  I know that each column in an ALV Grid can display at most 128 characters.  Since my SAP is an Unicode system, I expect that each column in my ALV Grid can display 128 Chinese characters, too.  However, the ALV Grid only display 42 Chinese characters at most.  Is this a bug in ALV Grid?  How can I fix it?
    I did a small experiment.  The results are listed below.  My version is Net Weaver 7.01.  The results show that the bug does not exist in ALV List.  However, my user prefers ALV Grid, which is more beautiful and elegant.
    Type of ALV
    Max number of
    ASCII character
    in an ALV column
    Max number of
    non-ASCII character
    in an ALV column
    REUSE_ALV_GRID_DISPLAY
    128
    42 Chinese characters
    CL_SALV_TABLE
    128
    42 Chinese characters
    CL_GUI_ALV_GRID
    128
    42 Chinese characters
    REUSE_ALV_LIST_DISPLAY
    132
    132 Chinese characters
    If you encounter the bug, please post your solution.  Thanks a lot. 

    It looks like limitation of ALV grid cell, which can contain up to 128 bytes in SAP gui.
    Your unicode characters are probably 3 bytes each.
    Check OSS Note 910300 for more detailed info.
    EDIT: Note 1401711 seems to be a correction for your issue It allows to use 128 characters (even if they take more than 128 bytes).

  • Keystroke return and ASCII character 13 and 10 not working in

    I have the following script to opens a web page of my internal telephone switch (all in the local network) and fill in the two fields that come up and needs filled out in order to log in.
    tell application "Safari"
    activate
    open location "http://192.168.1.90/"
    end tell
    tell application "System Events"
    delay 1
    keystroke tab
    delay 1
    keystroke "" -- Note: Username goes here if one is wanted/needed
    delay 1
    keystroke "XYZ" -- Note: Password goes here if one is wanted/needed
    delay 1
    keystroke (ASCII character 13)
    end tell
    All works fine, it skips the first field (the login name is blank). Puts the password in the next field. However it refuses to activate the “log-in” button of the login window (the one that is blue and normally can be done with the enter key).
    I tried:
    keystroke (ASCII character 13)
    keystroke (ASCII character 10)
    keystroke return
    keystroke enter
    Non of them do the job.
    Any suggestions please? Thanks.

    Consider replacing ...
    keystroke (ASCII character 13)
    ... with ...
    tell document 1 to do JavaScript "document.myform.submit()"
    ... where 'myform' will have to be replaced with the forms' name.
    To obtain the forms' name ...
    01. Perform a right ('control' if single button mouse) button click on the form based web page. A contextual menu will appear.
    02. Select the 'View Source' menu item. A new 'Safari' will appear with the title beginning with 'Source of ...'.
    03. Look for a line similar to ...
    <form name="myform" action="submit-form.php">
    ... Note, the name="myform". This is the forms' name. Whatever is between the name="" is what you need to substitute 'myform' with, in 'tell document 1 to do JavaScript "document.myform.submit()"'.
    I entered ...
    tell application "Safari" to tell document 1 to do JavaScript "document.myform.submit()"
    ... in 'Script Editor', and visited 'JavaScript Form Submit example'. When the AppleScript code was executed, the web page responded accordingly.
    New test of code. With 'JavaScript Form Submit example' again displayed, the following code ...
    set tValue to "ChangeAgent"
    tell application "Safari"
    tell document 1
    do JavaScript ("myform.query.value=\"" & tValue & "\"")
    do JavaScript "document.myform.submit()"
    end tell
    end tell
    ... was entered into 'Script Editor', and executed.
    The results were as expected - the resultant web page reported ...
    Great! The Form is Submitted Successfully!
    Query:'ChangeAgent'
    Back
    ... And, the code was condensed even further ...
    set tValue to "ChangeAgent"
    tell application "Safari" to tell document 1 to do JavaScript ("myform.query.value=\"" & tValue & "\"; document.myform.submit()")
    ... producing the desired results.

  • Is Linksys WRT54GH SSID can contains the non-ascii character?

    is Linksys WRT54GH SSID can contains the non-ascii character?
    we need to use it for our wireless testing, but i dont know if the SSID can contains non-ascii.
    anybody can help me? hurry, i will wait answer online.
    thanks in advance!
    Solved!
    Go to Solution.

    thank you  very much, Ricewind
    SSID cant contain non-ascii characters, it make me sad and disappointed
    why we can  set T-link router SSID with non-ascii characters?

  • Unicode value of a non-ASCII character

    Hi,
    Suppose, the unicode value of the character &#2381; is '\u094d'.
    Is there any Java function which can get this unicode value of a non-ASCII character.
    Like:
    char c='&#2381;';
    String s=convertToUnicode(c);
    System.out.println("The unicode value is "+ s);
    Output:
    The unicode value is \u094d
    Thanks in advance

    Ranjan_Yengkhom wrote:
    I have tried with the parameter
    c:\ javac -encoding utf8 filename.java
    Still I am getting the same print i.e. \u3fIf it comes out as "\u3f" (instead of failing to compile or any other value), then your source code already contains the question mark. So you already saved it wrong and have to re-type it (at least the single character).
    >
    Then I studied one tutorial regarding this issue
    http://vietunicode.sourceforge.net/howto/java/encoding.html
    It says that we need to save the java file in UTF-8 format. I have explored most of the editors like netbean, eclipse, JCreator, etc... there is no option to save the java file in UTF-8 format.That's one way. But since that is so problematic (you'll have to remember/make sure to always save it that way and to compile it using the correct switch), the better solution by far is not to use any non-ASCII characters in your source code.
    I already told you two possible ways to achieve that: unicode escapes or externalized strings.
    Also read http://www.joelonsoftware.com/articles/Unicode.html (just because it's related, essential information and I just posted that link somewhere else).

  • Identify InfoObjects that have a non-7-bit-US-ASCII character in key

    Hello,
    we plan to do a Unicode migration with our BW. SAP recommends, that in order to prevent problems during data extraction all keys of the characteristic InfoObjects should only contain 7-bit-US-ASCII characters.
    But we have manually (by hazard) identified some master data records that contain some non-7-bit-US-ASCII characters (like for example "Ö" or "Ä").
    We'd now like to check ALL characteristic InfoObjects regarding this issue.
    Does anybody know about an ABAP-Report that would ease that task? Generally spoken, the programm should walk through the list of all characteristic InfoObjects and check for each one the master data table for "bad" keys (i. e. keys that contain a non-7-bit-US-ASCII character).
    Thanks to any answers in advance!
    Best regards,
    Philipp

    I tested your code today,
                         dialog           save           open
    Firefox 1.5          OK                 OK               OK
    IE 6.0                OK                 OK                NGdailog: filename show in download popup dialog
    save: save to disk from dialog
    open: open directly from dailog

  • Remove non ascii character

    i need a SQL or Procedure that will search non ascii character  in data and update the data by removing it
    Suppose there is table TABLE1 with Column NAME
    it contain number of row and few has non ascii character eg 'CharacterÄr'
    My sql or procedure should be able to search  'CharacterÄr' and update the row with 'Character'
    i.e. removing the non ascii character 'Ä' from the data

    Hi,
    Okay, in that case:
    SELECT str
    ,      REGEXP_REPLACE ( str
                          , '[^[:cntrl:] -~]'
                          )   AS new_str
    FROM    table_x
    or, to actually change the rows that contain the bad characters:
    UPDATE  table_x
    SET     str = REGEXP_REPLACE ( str
                                 , '[^[:cntrl:] -~]'
    WHERE   REGEXP_LIKE ( str
                        , '[^[:cntrl:] -~]'

  • Ascii character 129 for newline in the text file

    Hi there,
    I have java program that makes JDBC connection and reads through a table, write a column in text file, after each column puts delimiter "|"and after each row prints in the next line.
    This is the code below.
    public void queryRecords() {
             Statement stmt           = null;
            ResultSet rset           = null;
            try {
                  stmt = con.createStatement();
                  int numRows = 0;
                File file           = new File("/tmp/temp.txt");
                FileWriter writer   = new FileWriter(file, false);
                BufferedWriter pw      = new BufferedWriter(writer);
                rset = stmt.executeQuery("SELECT * FROM mytable");
                ResultSetMetaData rsmd = rset.getMetaData();
                int colCount = rsmd.getColumnCount();
                while (rset.next()) {
                    for (int i = 1;i <= colCount; i++) {
                        String st = rsmd.getColumnTypeName(i);
                        if (st.equals("DATE")) {
                            Date d1 = rset.getTimestamp(i);
                            pw.write(d1 + "|");
                        } else {
                            Object o1 = rset.getObject(i);
                            if (o1 != null) {
                                pw.write(o1 + DELIM);
                            } else {
                                pw.write(DELIM);
                    pw.newLine();
                pw.close();
                 rset.close();
                 stmt.close();When i open this Temp.txt file in notepad i see ascii character 129 (rectangular box) instead of the new line. But when i print the file i have each row in a separate line.
    Why could this be happening??
    Please help...

    hi,
    Try PrintWriter instead :
    File file = new File("D:/testing.txt");
            //FileWriter writer   = new FileWriter(file, false);
            //BufferedWriter pw      = new BufferedWriter(writer);
            PrintWriter pw = new PrintWriter(file);
            pw.print("aaa");
            pw.print("|");
            pw.print("aaa");
         public static void main(String[] args) throws Exception {
              File file = new File("/test/test.txt");
            //FileWriter writer   = new FileWriter(file, false);
            //BufferedWriter pw      = new BufferedWriter(writer);
            PrintWriter pw = new PrintWriter(file);
            pw.print("aaa");
            pw.print("|");
            pw.print("aaa");
            pw.print("|");
            pw.print("aaa");
            pw.println();
            pw.print("aaa");
            pw.print("|");
            pw.print("aaa");
            pw.print("|");
            pw.print("aaa");
            pw.close();
         }hth

Maybe you are looking for

  • How do I set up my work email account on my iPhone?

    I have an iPhone by my IT department won't support it. So I have to set-up my email myself. The problem is I'm not sure what info to fill in and where. I am able to access my email using remotemail on the web so I'm hoping I can use that info. My det

  • Search in Google no Longer works--still

    Although it is visible, when I select text and choose "Search in Google" from within an e-mail, nothing happens. This holds true for both my imap and smtp accounts. Safari does not open, nor Firefox. I have tried setting and resetting my preferred br

  • Error ERR-1002 Unable to find item ID for item "" in application "11501"

    Hi All, I am new to Apex, still a beginner. Please need your help on this. We recently upgraded to Apex 4.1 from Apex 3.0. The database version is 10.2.0.4. I am getting this below error. Error ERR-1002 Unable to find item ID for item "" in applicati

  • SRM PO Update with WBS Element

    Hello, I have a requirement for a report in SRM which should update the account assignment in SRM-PO with the new WBS Element / Fund. Now, I am little new to SRM programming. Could some one give me detailed steps as to what FMs do I need to use and h

  • How does Oracle Prefetch work?

    There are 1000 rows in a table and I fire a "select *" query with a prefetch count of 100. How are the chunks of rows retrieved? Scenario one: Get first 100 row, wait till cursor rolls over to 101th row, then fetch 100 more rows. Scenario two: Get fi