Google Answers Logo
View Question
 
Q: Interpretation of ASCII ( Answered,   4 Comments )
Question  
Subject: Interpretation of ASCII
Category: Miscellaneous
Asked by: ga1000-ga
List Price: $5.00
Posted: 10 Feb 2003 16:26 PST
Expires: 12 Mar 2003 16:26 PST
Question ID: 159713
(a) in the ASCII characters below, I can guess the meaning of some,
such as BEL to make a sound, BS=back space, LF=line feed, CR= carriage
return.

Please fill in the blanks for the remaining ones, if you can.
007     7       07      BEL '\ea'               
010     8       08      BS  '\eb'               
011     9       09      HT  '\et'               
012     10      0A      LF  '\en'               
013     11      0B      VT  '\ev'               
014     12      0C      FF  '\ef'        
015     13      0D      CR  '\er'        
016     14      0E      SO              
017     15      0F      SI              
020     16      10      DLE     

(b) What is the ASCII representation of the 'enter' key?

Thank you.
Answer  
Subject: Re: Interpretation of ASCII
Answered By: kyrie26-ga on 10 Feb 2003 16:35 PST
 
Hi there ga1000-ga,

Thank you for your question. The leftmost column represents Octal
values. I found the answers at http://www.asciitable.com/ :

007     7       07      BEL '\ea'       (bell)
010     8       08      BS  '\eb'       (backspace)
011     9       09      HT  '\et'       (horizontol tab)
012     10      0A      LF  '\en'       (NL line feed, new line)
013     11      0B      VT  '\ev'       (vertical tab)
014     12      0C      FF  '\ef'       (NP form feed, new page)
015     13      0D      CR  '\er'       (carriage return)
016     14      0E      SO              (shift out)
017     15      0F      SI              (shift in)
020     16      10      DLE             (data link escape) 


Google search term :

ascii table


Thank you for using Google Answers!


Regards,

kyrie26-ga

Clarification of Answer by kyrie26-ga on 10 Feb 2003 16:39 PST
I forgot to mention - the ASCII representation of the 'enter' key, on
the Windows platform, is the CR character followed by LF, or
ASCII(10)-ASCII(13). In some notations this is \r\n.

Request for Answer Clarification by ga1000-ga on 10 Feb 2003 17:56 PST
Just one more clarification regarding question (2).

Is the \n mentioned the same as in a c code like printf("hello\n")?
The \n in the c code seems to do both the line feed(create a new line)
and carriage return(move the cursor to the 1st column), act like an
'enter'.

So these two \n have different meanings?

Clarification of Answer by kyrie26-ga on 10 Feb 2003 19:22 PST
You are correct. The C implementation does both the CF and LF, and
that is contained in the "\n". The "\r\n" I was referring to, is what
I've seen from MySQL data files, and may be in use elsewhere too. Hope
that clears up the confusion. Thanks!
Comments  
Subject: Re: Interpretation of ASCII
From: bavi_h-ga on 11 Feb 2003 01:24 PST
 
Here are some interesting links I found from previous
research about the ASCII control codes:


The ASCII Control Characters by Adrian Wichello
http://astro.uni-tuebingen.de/~wilms/computers/lowascii.html

  Provides a historical perspective behind the meanings
  of the ASCII control characters' names.


Ascii control codes (control characters, C0 controls)
http://www.cs.tut.fi/~jkorpela/chars/c0.html

  A stricter definition of the control codes.
Subject: Re: Interpretation of ASCII
From: ga1000-ga on 11 Feb 2003 08:34 PST
 
Bavi_h.ga:

Information very useful.

Thank you very much.
Subject: Re: Interpretation of ASCII
From: efn-ga on 11 Feb 2003 10:06 PST
 
In the C programming language, '\r' is defined to move the active
position to the beginning of the current line and '\n' is defined to
move the active position to the beginning of the next line.  How '\n'
is represented in the execution character set is
implementation-dependent, since different platforms have different
formats for text.  It may be ASCII CR, LF, or CR followed by LF, or it
may not be ASCII at all, depending on the target platform.

So in general, there would be no point in coding "\r\n".  You might
see this in code that was writing text to be read on a different
platform, where the compiler generates CR for '\r' and LF for '\n' and
the platform that will read the text wants to see CR-LF at the ends of
lines.

--efn
Subject: Re: Interpretation of ASCII
From: ga1000-ga on 11 Feb 2003 12:57 PST
 
efn-ga:

Thank you for the comment.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy