Question on ascii characters and bytes

Is there a difference between an 8 bit ascii character and a byte.
I need to display characters to an LCD display - the chip on the display will accept 8 bit ascii characters, but I need to send them to the serial port in a byte array, does this mean they are not in 8 bit ascii format when they reach the chip on the display.
If they are different is it possible to send the ascii characters to the serial port as actual ascii characters.
Cheers David

you should be just able to create a byte array, fill the array with downcasted char's and then it off to the serial port via the outputstream.
byte[] tmp = new byte[2];
tmp[0] = (byte)'H';
tmp[1] = (byte)'I';
os = serailport.getOutputStream();
os.write(tmp);
(i think that's it)
an ascii character is just a particular representation of a byte string. it doesnt really mean anything. so you could rewrite the above using the hex/decimal values from the ascii char set.
a winn

Similar Messages

  • CMSDK Non-ASCII Characters and WebFolders

    Hi,
    i have the follow problems with the CMSDK and Microsoft.
    windows-explorer:
    It is impossible to enter a folder that contains non-ascii characters in the name.(the clientrequest will never send.)
    After the doubleclick on the foldername, i get a errormessage an then the url in the editbox is ISO-8859-1 encoded, but this url will never send to the sever.
    Other operations like create, rename, ... have no problems with non-ascii chars.
    with the IE, i can enter without a problem.
    MS Word:
    I can't save any file with non-ascii chars in the name.
    Only this methods are send:
    PROPFIND
    PROPFIND
    GET
    GET
    But never a "PUT", without a non-ascii char in the name the traffic looks like this:
    PROPFIND
    PROPFIND
    GET
    GET
    PROPFIND
    LOCK
    PUT
    It is also impossible to enter a folder containing non-ascii characters in the name, form the word filesave-dialog.
    URL UTF-8 encoding is enabled in the IE options and other operations (MOVE,COPY) are send correctly UTF-8 encoded.
    is there any solution?
    thanks
    Maik

    Have you set the following DAV Server configuration property:
    IFS.SERVER.PROTOCOL.DAV.Webfolders.DefaultCharset
    for your domain?
    You have to configure it for the character set that you want your clients to use when connecting to iFS via WebDAV.
    (You can use the web admin tool to change this property.)
    The reason for this is that the Microsoft WebFolders client software does not transmit the client's character set to the server, so the server has no way of knowing what to expect.

  • I have a neslab chiller and want to read the temperature by sending ASCII characters and graph the results, any advice?

    I am having difficulty having the chiller recognize (RT[CR]) which is the signal recognized by the chiller to read the temperature. The signal that is returned is (xxx.xx[CR]) which is the temperature. I am attempting to be able to read the temperature and graph this vs time and possibly be able to change the setpoint as well from the UIR.

    I agree with Randy that Hyperterminal is a good starting point to test cabling and communication.
    In your program, be careful to serial port initialization (how to set baud rate, parity, data bits and stop bits depends on the language used) and to termination character ([CR] means Carriage return: if you are usng CVI it DOESN'T add CR to the message unless you esplicitly put it in).
    Another interesting point is the time the instrument takes to respond to the message: it can vary from message to message and is usually described in the instrument's documentation. If you test for a shorter time, you catch a false 'no response'. You could make a while loop and test in it the number of bytes received, then decide whether to end the loop for timeout or answer recei
    ved...
    To continue help you, we need some details of your developing environment (CVI or LabVIEW?) and of problems you are having at present.
    Hope to hear you soon
    Roberto
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • NSString with Unicode + ASCII characters

    Hi All,
    I am developing an mac application in 10.5.
    I need to deal with normal ASCII characters and Unicode characters.
    I want to calculate number of bytes taken to store the string.
    I am using [[unicodeStr dataUsingEncoding:NSUTF8StringEncoding]bytes].
    This is working fine if "unicodeStr" string has only unicode characters.
    If "unicodeStr" it is combination of (unicode characters + ASCII Characters) "NSUTF8StringEncoding" is not working.
    Can anybody tell me how to proceed??
    Thanks in advance.

    There is no such thing as a combination of Unicode and ASCII. ASCII is part of Unicode. Any ASCII string is a valid UTF8 string.

  • Validation for non-ASCII characters

    Hi all,
    Requirement: I have to apply a validation on on fields like Name and Address in applicationdefination.xml. When a user types non-ASCII characters and navigates to next page then it should display the error message. Thus, I have to restrict my user to ASCII values only.
    Present Situation: I'm using regular expression for this problem. In Jheadstart there is an option regular expression under the heading Validation. I have written following values in regular expression and Regular Expression Error Message options.
    Regular Expression
    ^\s*[\w\.\,\-\_\(\)\#\'\/\\\ u0022\u0026\*\;\:\s]+\s*$
    Regular Expression Error Message
    It is important to note that foreign characters are not accepted on our system. Please ensure only standard English letters are entered
    Since, i was getting error in jspx page due to double quotes(") and ampercent(&), So i have replaced the double quotes(") and amprecent(&) by their unicodes. Thus, the expression has become like ^\s*[\w\.\,\-\_\(\)\#\'\/\\\u0022\u0026\*\;\:\s]+\s*$.
    This expression is validating many characters like Ã,µ,Ç,Ï,Ö,§,¥,{,} but not all non ASCII characters like ѓ є ѕ ї Њ Щ Ώ Ω Ϊ Ά Ή Θ Λ Ξ Π τ ẫ ờ Ỡ Ứ Ỷ ự Ẁ ỹ ị Ọ ň ũ ť ţ Έ Ϊ ﻍ. Thus, its not fulfilling the requirement.
    Please suggest some valid solution to this problem. It’s very urgent.

    Hi,
    The validation seems to be performed in Java or Javascript depending on the layout (I'm sorry I can't remember the exact details). The expression suggested above by theEternalStudent works very well in Java, but not in Javascript.
    We came up with an expression which works in both. It rejects strings which contain &# by doing a lookahead before the main pattern - you might want to expand this to look for &#nnn; but for our purposes &# is enough.
    Here is the "platform neutral" solution:
    (?!.*\u0026#.*)^[\w\.\,\-\_\(\)\#\'\/\\\u0022\u0026\*\;\:\s]+$
    I think in future we will write a javascript function and amend the templates to call it directly.
    thanks,
    Michael

  • Normal string ASCII characters are not shown after using string reversal.

    In a VI that I have written, there is a point where I take a simple 5 character string and input it to a reverse string node.  I also have an indicator on the output of the reverse string node so I can look at the reversed string.  Both the input and output indicators are in normal display mode.   For the input indicator I can see the input string with no problem.  But on the indicator at the output of the reverse string node I see nothing.  If I then put each of the indicators in HEX display mode, both indicators display the hex equivalent characters of the original ASCII characters, and the output indicator shows the characters reversed from that of the input indicator, as expected.  So why when I am in normal display mode, are the characters in the output indicator not showing up?  Thanks.

    What are the ASCII values that you are trying to display?  Perhaps they are non-printable ASCII values.
    Perhaps you can post a simple VI with the values in a string control and saved as a default.
    EDIT:  After seeing Rod's message, that seems very likely, especially considering that there is likely an EOL character if you are doing serial communication with some other device.
    Message Edited by Ravens Fan on 03-23-2009 12:04 PM

  • Given filename or path contains Unicode or double-byte characters.Retry using ASCII characters for filename and path What does this mean? it happen when I publish an OAM

    Given file name or path contains Unicode or double-byte characters. Retry using ASCII characters for filename and path
    What does this mean? It is happening when I try to publish an OAM for Dreamweaver.
    Also: How can I specify the browser in Edge Animate? It is just going wherever. Are there no Preferences for Edge Animate?
    BTW. Just call it Edge. Seriously. Do you call it Illustrator Draw? Photoshop Retouching?

    No, my file name is mainContent.oam
    My project name is mainContent.an
    This error happens when I try to import into Dreamweaver. Sorry, I wasn't clear on that earlier.
    I thought maybe it was because I had saved my image as a png. So re-saved as a svg, still get the error.
    DO I have a setting is Dreamweaver CC that is wrong? Should I try this in Dreamweaver CS6? I might try that next.
    Why is this program so difficult? I know Flash. I know After Effects. I can work the timeline part just great. It's always in the export that I have problems.
    On a MacPro, 10.7.
    Are you an Adobe person or just a nice helper?

  • Convert smart quotes and other high ascii characters to HTML

    I'd like to set up Dreamweaver CS4 Mac to automatically convert smart quotes and other high ASCII characters (m-dashes, accent marks, etc.) pasted from MS Word into HTML code. Dreamweaver 8 used to do this by default, but I can't find a way to set up a similar auto-conversion in CS 4.  Is this possible?  If not, it really should be a preference option. I code a lot of HTML emails and it is very time consuming to convert every curly quote and dash.
    Thanks,
    Robert
    Digital Arts

    I too am having a related problem with Dreamweaver CS5 (running under Windows XP), having just upgraded from CS4 (which works fine for me) this week.
    In my case, I like to convert to typographic quotes etc. in my text editor, where I can use macros I've written to speed the conversion process. So my preferred method is to key in typographic letters & symbols by hand (using ALT + ASCII key codes typed in on the numeric keypad) in my text editor, and then I copy and paste my *plain* ASCII text (no formatting other than line feeds & carriage returns) into DW's DESIGN view. DW displays my high-ASCII characters just fine in DESIGN view, and writes the proper HTML code for the character into the source code (which is where I mostly work in DW).
    I've been doing it this way for years (first with GoLive, and then with DW CS4) and never encountered any problems until this week, when I upgraded to DW CS5.
    But the problem I'm having may be somewhat different than what others have complained of here.
    In my case, some high-ASCII (above 128) characters convert to HTML just fine, while others do not.
    E.g., en and em dashes in my cut-and-paste text show as such in DESIGN mode, and the right entries
        –
        —
    turn up in the source code. Same is true for the ampersand
        &
    and the copyright symbol
        ©
    and for such foreign letters as the e with acute accent (ALT+0233)
        é
    What does NOT display or code correctly are the typographic quotes. E.g., when I paste in (or special paste; it doesn't seem to make any difference which I use for this) text with typographic double quotes (ALT+0147 for open quote mark and ALT+0148 for close quote mark), which should appear in source code as
        “[...]”
    DW strips out the ASCII encoding, displaying the inch marks in DESIGN mode, and putting this
        "[...]"
    in my source code.
    The typographic apostrophe (ALT+0146) is treated differently still. The text I copy & paste into DW should appear as
        [...]’[...]
    in the source code, but instead I get the foot mark (both in DESIGN and CODE views):
    I've tried adjusting the various DW settings for "encoding"
        MODIFY > PAGE PROPERTIES > TITLE/ENCODING > Encoding:
    and for fonts
        EDIT > PREFERENCES > FONTS
    but switching from "Unicode (UTF-8)" to "Western European" hasn't solved the problem (probably because in my case many of the higher ASCII characters convert just fine). So I don't think it's the encoding scheme I use that's the problem.
    Whatever the problem is, it's caused me enough headaches and time lost troubleshooting that I'm planning to revert to CS4 as soon as I post this.
    Deborah

  • Search for users and non-ASCII characters

    I am having a little issue with the "Accounts - Find Users" functionality. The search breaks on what I assume is non-ASCII characters (we use the following three up here in Denmark: �, �, �). To be precise, I have a user with the first name "J�rgen". Searching for first names starting with "J" works just fine but "J�" returns zero matches.
    My setup is with two machines, one (A) holding the MySQL database and one (B) serving Identity Manager on top of tomcat.
    Both A and B are RHEL boxes, and both have da_DK.UTF-8 as default locale.
    MySQL's /etc/my.cnf file has the following entry (as recommended in create_waveset_tables.mysql):
    [mysqld]
    default-character-set=utf8
    default-collation=binFor clarity, some functionality works just fine in Identity Manager with these non-ASCII characters such as adding a user whose name contains non-ASCII characters (not only ��� but also � for example). At the moment, it appears to be the search functionality which is not working correctly as I would expect it to. I'm still on the fence concerning whether I've missed something in terms of configuration, or whether this is a limitation.
    Does anyone know whether this problem is on my side or the software's side?

    I am having a little issue with the "Accounts - Find Users" functionality. The search breaks on what I assume is non-ASCII characters (we use the following three up here in Denmark: �, �, �). To be precise, I have a user with the first name "J�rgen". Searching for first names starting with "J" works just fine but "J�" returns zero matches.
    My setup is with two machines, one (A) holding the MySQL database and one (B) serving Identity Manager on top of tomcat.
    Both A and B are RHEL boxes, and both have da_DK.UTF-8 as default locale.
    MySQL's /etc/my.cnf file has the following entry (as recommended in create_waveset_tables.mysql):
    [mysqld]
    default-character-set=utf8
    default-collation=binFor clarity, some functionality works just fine in Identity Manager with these non-ASCII characters such as adding a user whose name contains non-ASCII characters (not only ��� but also � for example). At the moment, it appears to be the search functionality which is not working correctly as I would expect it to. I'm still on the fence concerning whether I've missed something in terms of configuration, or whether this is a limitation.
    Does anyone know whether this problem is on my side or the software's side?

  • Display extended ascii characters as question mark in xml file

    I am creating a XML file with encoding as UTF-8. Some tag values contain some extended ascii characters. When i run the java program to create the file in windows, the extended ascii characters are display correctly. But in linux it is displaying as ?(question mark).
    i am not able to rectify this. can anyone help me....
    Its urgent
    Thanks in advance.
    Message was edited by:
    Rosy_Thomas@Java

    Probably the locale is not set for the shell you are running in. The default 'C' locale uses the ASCII encoding which defines only 128 characters. See if giving the commandexport LC_CTYPE=en_US.UTF-8before starting the program fixes the issue.

  • UTF8 Byte Size for ASCII Characters

    In a UTF8 database, are ASCII characters stored as a single byte, therefore using the minimum amount of db space possible? Or are they stored at a fixed amount of 2 or 3 bytes, wasting db space unnecessarily?

    Hi,
    The Ascii characters are single bytes. So don't worry about space.

  • Web services and High Ascii characters

    Hello Everyone
    I have a problem regarding webservices and sending high ascii
    characters.
    My little application consists of two files: one is cfm that
    makes a view and the second is cfc that might be working as the
    component or web service.
    The goal of the application is to handle text files, divide
    them according to some rules and then send back to the user.
    Sometimes the text file contains few high ascii characters.
    Everything works fine as long as the cfc is called as the
    component. Unfortunately when I call the cfc as the webservice I
    get an error:
    The web service operation caused an invocation exception.The
    root cause was that: java.lang.IllegalArgumentException: The char
    '0x1' in 'java.lang.IllegalArgumentException: and so on....
    AxisFault
    faultCode: {
    http://xml.apache.org/axis/}HTTP
    faultSubcode:
    faultString: (500)Internal Server Error
    faultActor:
    faultNode:
    faultDetail:
    {}:return code: 500
    Do you know how can I solve my problem? I've tried different
    stuff with encoding but it didn't work.
    Thanks for all answers.

    Whatever Coldfusion's means of communication with the database, by default, it represents text meant for the browser in UTF-8.

  • Username with ascii characters

    Hello, i'm having and html form and i would like the user in
    the username field to type ONLY ascii characters.
    For example, in other fields of the form i
    would like the user to type his mother language but
    as far as the username and password fields are concerned
    the characters have to be ascii.
    How am i supposed to check when the username is accepted/correct (*consists of ascii characters*)?
    and which are the desirable characters a username must have (e.g. *?* is a desirable character in a username , *:* this one?)
    Thanks, in advance!

    g_p_java wrote:
    How am i supposed to check when the username is accepted/correct (*consists of ascii characters*)?ASCII characters are the Unicode characters whose code points are between 0 and 127.
    and which are the desirable characters a username must have (e.g. *?* is a desirable character in a username , *:* this one?)I don't understand this. You have already said they must be ASCII. You have other requirements? Fine, go ahead and program them and ask questions if you have problems with that. Personally I don't think that requiring somebody to have a question mark in their user name is a good idea -- but probably you didn't mean it when you suggested that.

  • Non ascii characters being sent from a parameter in a form

    Hi!
    I have seen many topics posted on passing non ascii characters through parameters from one servlet to another and converting them into whatever format is necessary.
    However, I have not seen anyone answer the following question. I have a jsp page (html) with the character encoding set to utf-8. The user inputs some data in to a text field which is inside a form. The data could be in non ascii characters such as hebrew or arabic. This form is then sent to another jsp where i try to retreive the data from teh text field. No matter what i do, i cannot get the data presented correctly. It is either question marks or other wierd symbols.
    I have tried every permetation of encoding of the actual html page, the ecoding of the string from request.getParameter etc but it still is not presented on the new html page correctly.
    Can anyone help??
    Spencer

    Ok, I solved the problem.
    I had to put at the top request.setCharacterEncoding("utf-8");
    Spencer

  • How can I convert ASCII characters to ISO8859?

    Hi All,
    I have written a little application that renames a TV episode by scraping a TV listing site for the episode name. It is written in SWT and works great apart from on small problem. When getting the html back from the site, it sometimes contains special ASCII characters that are not in the ISO8859 (Windows filesystem) character set.
    For example, this is the line that I have to parse:
    <td style='padding-left: 6px;' class='b2'><a href='/Prison_Break/episodes/569183/03x01'>Orientaci��n</a></td>When viewing it in a browser, it is:
    <td style="padding-left: 6px;" class="b2"><a href="/Prison_Break/episodes/569183/03x01">Orientaci�n</a></td>Notice that the o in the title has an accent on it. While researching this problem I stumbled across 'HTML Entities to ISO 8859-1 Converter' at http://www.inweb.de/chetan/English/Resources/Java/HTML%202%20ISO.html. This open source project takes in an html entity like & and returns '&'.
    So that is not quite what I want, as my BufferedReader is converting the html entity into the ASCII representation already. I need a way of detecting a non ISO8859 character within an ASCII string, and hopefully replacing its natural 'equivalent' (would be o in this case).
    Does anyone know how I could do it without having to check for every special char and replacing (not really an option unless someone has done it before!!)
    If not that then, perhaps another way to attack the problem?
    Any help greatly appreciated ;)
    Dave

    Hi,
    NZ_Dave wrote:
    For example, this is the line that I have to parse:
    <td style='padding-left: 6px;' class='b2'><a href='/Prison_Break/episodes/569183/03x01'>Orientaci��n</a></td>
    This is coded in UTF-8. If you convert the bytes to a String using the UTF-8 encoding, then you will have the correct characters "Orientaci�n" in the string.
    Check your parser where it converts the bytes (coming from e.g. an InputStream) to characters. Use UTF-8 as the charset when doing that conversion.

Maybe you are looking for