Questions tagged [ascii]

A character-encoding scheme based on the ordering of the English alphabet. ASCII stands for American Standard Code for Information Interchange.

ASCII codes represent text in computers, communications equipment, and other devices that use text. Most modern character-encoding schemes are based on ASCII, though they support many more characters than did ASCII.

ASCII includes definitions for 128 characters: 33 are non-printing control characters (now mostly obsolete) that affect how text and space is processed; 94 are printable characters, and the space is considered an invisible graphic. The most commonly used character encoding on the World Wide Web was US-ASCII until December 2007, when it was surpassed by UTF-8.

The following table contains the 128 ASCII characters.

Char  Dec  Oct Hex | Char Dec  Oct Hex | Char Dec  Oct Hex | Char Dec  Oct  Hex
(nul)   0 0000 x00 | (sp)  32 0040 x20 | @     64 0100 x40 | `      96 0140 x60
(soh)   1 0001 x01 | !     33 0041 x21 | A     65 0101 x41 | a      97 0141 x61
(stx)   2 0002 x02 | "     34 0042 x22 | B     66 0102 x42 | b      98 0142 x62
(etx)   3 0003 x03 | #     35 0043 x23 | C     67 0103 x43 | c      99 0143 x63
(eot)   4 0004 x04 | $     36 0044 x24 | D     68 0104 x44 | d     100 0144 x64
(enq)   5 0005 x05 | %     37 0045 x25 | E     69 0105 x45 | e     101 0145 x65
(ack)   6 0006 x06 | &     38 0046 x26 | F     70 0106 x46 | f     102 0146 x66
(bel)   7 0007 x07 | '     39 0047 x27 | G     71 0107 x47 | g     103 0147 x67
(bs)    8 0010 x08 | (     40 0050 x28 | H     72 0110 x48 | h     104 0150 x68
(ht)    9 0011 x09 | )     41 0051 x29 | I     73 0111 x49 | i     105 0151 x69
(nl)   10 0012 x0a | *     42 0052 x2a | J     74 0112 x4a | j     106 0152 x6a
(vt)   11 0013 x0b | +     43 0053 x2b | K     75 0113 x4b | k     107 0153 x6b
(np)   12 0014 x0c | ,     44 0054 x2c | L     76 0114 x4c | l     108 0154 x6c
(cr)   13 0015 x0d | -     45 0055 x2d | M     77 0115 x4d | m     109 0155 x6d
(so)   14 0016 x0e | .     46 0056 x2e | N     78 0116 x4e | n     110 0156 x6e
(si)   15 0017 x0f | /     47 0057 x2f | O     79 0117 x4f | o     111 0157 x6f
(dle)  16 0020 x10 | 0     48 0060 x30 | P     80 0120 x50 | p     112 0160 x70
(dc1)  17 0021 x11 | 1     49 0061 x31 | Q     81 0121 x51 | q     113 0161 x71
(dc2)  18 0022 x12 | 2     50 0062 x32 | R     82 0122 x52 | r     114 0162 x72
(dc3)  19 0023 x13 | 3     51 0063 x33 | S     83 0123 x53 | s     115 0163 x73
(dc4)  20 0024 x14 | 4     52 0064 x34 | T     84 0124 x54 | t     116 0164 x74
(nak)  21 0025 x15 | 5     53 0065 x35 | U     85 0125 x55 | u     117 0165 x75
(syn)  22 0026 x16 | 6     54 0066 x36 | V     86 0126 x56 | v     118 0166 x76
(etb)  23 0027 x17 | 7     55 0067 x37 | W     87 0127 x57 | w     119 0167 x77
(can)  24 0030 x18 | 8     56 0070 x38 | X     88 0130 x58 | x     120 0170 x78
(em)   25 0031 x19 | 9     57 0071 x39 | Y     89 0131 x59 | y     121 0171 x79
(sub)  26 0032 x1a | :     58 0072 x3a | Z     90 0132 x5a | z     122 0172 x7a
(esc)  27 0033 x1b | ;     59 0073 x3b | [     91 0133 x5b | {     123 0173 x7b
(fs)   28 0034 x1c | <     60 0074 x3c | \     92 0134 x5c | |     124 0174 x7c
(gs)   29 0035 x1d | =     61 0075 x3d | ]     93 0135 x5d | }     125 0175 x7d
(rs)   30 0036 x1e | >     62 0076 x3e | ^     94 0136 x5e | ~     126 0176 x7e
(us)   31 0037 x1f | ?     63 0077 x3f | _     95 0137 x5f | (del) 127 0177 x7f
6938 questions
2
votes
4 answers

Is this End of Transmission character or something else?

So I'm doing a string basics tutorial in standard C. I have: char mystring[] = "HAL"; for (int i = 0; i < 3; i++) mystring[i] += 1; for (int k = 0; k < 10; k++) printf("\n %d", mystring[k]); which outputs: 73 66 77 0 4 0 0 0 0 0 Now…
Austin
  • 6,921
  • 12
  • 73
  • 138
2
votes
2 answers

How can I find a single occurrence of a non-latin character using regular expressions?

I am using a regular expression to see if there is a single non-latin character within a string. $latin_check = '/[\x{0030}-\x{007f}]/u'; //This is looking for only latin characters if(preg_match($latin_check, $_POST['full_name'])) { $error =…
zeckdude
  • 15,877
  • 43
  • 139
  • 187
2
votes
2 answers

Making ASCII art print on the same line

I'm making a program which takes a file with an ASCII art alphabet and uses it to print words. It takes 3 lines of input The width, The Height and The desired word. My problem is that I can make the characters print on the same line, they print one…
user5303899
2
votes
1 answer

Reading stream of bytes from serial port in C#

I am new to c#. I have a serial (COM port) device which is streaming an array of bytes continuously. The array contains values of different sensors which are read by micro-controller. Basically the value of each sensor is shown by 8 bytes such that…
2
votes
5 answers

Entirely Javascript Ajax spinner?

I was thinking that Ajax spinners are really great but the image spinning is actually shown with some delay OR is loaded too early, I thought maybe I could use these old school characters to provide more accurate ajax activity feedback. |, /, —, \ …
Mohammad
  • 7,344
  • 15
  • 48
  • 76
2
votes
2 answers

Count number of char in a 2D grid C

I'm trying to count how many chars there in a 2D grid using 2 for loops. The code looks like this: int number_of_boxes( int player, int height, int width, char**gameBoard ){ int boxCount, i , a; for(i=0; i < (height*2) + 1 ; i++){ for ( a = 0…
2
votes
2 answers

how to distinguish norwegian characters

Norwegian alphabet have characters such as Ø, Å, Æ.. char character = 'Ø'; int ascii = (int) character; System.out.println(ascii); And it returns = 65533 char character = 'Æ'; int ascii = (int) character; …
vlcod
  • 229
  • 2
  • 3
  • 13
2
votes
1 answer

How to convert an array (with TRUE and FALSE values) to binary string to ASCII characters?

I have a list of permissions arranged in an array, for example: $permissions = array(true, true, false, false, true, ...); My intention is to convert the array to a chain of 1's and 0's: $pseudo_binary = array_to_binary($permissions);…
Rodrigo
  • 567
  • 7
  • 24
2
votes
0 answers

ASCII and newlines

Here's a string: "Hello\r\nHow are you?" I saved this string into my DB two ways: 1) by copying this exact string into the console then saving; 2) by typing it (with an actual newline rather than \r\n) into the object's form and submitting it. Both…
sscirrus
  • 55,407
  • 41
  • 135
  • 228
2
votes
2 answers

Check if a file contains certain ASCII characters

I need a unix command to verify the file has ASCII printable characters only (between ASCII Hex 20 and 7E inclusive). I got below command to check if file contains non-ASCII characters, but cannot figure out my above question. if LC_ALL=C grep -q…
austin
  • 45
  • 1
  • 11
2
votes
0 answers

Import csv to mogodb collection- Invalid UTF-8 character detected

I am trying to import csv file into mongodb collections by following command mongoimport -d mydb -c locations --type csv --file locations.csv --headerline it is giving exception:Invalid UTF8 character detected command file locations.csv is…
Ammar Hayder Khan
  • 1,287
  • 4
  • 22
  • 49
2
votes
3 answers

Add emoji to Android keyboard

I'm making my own custom keyboard and I have a problem with adding emoji to it. As a android:keyIcon I have a drawable of that emoji and I need android:codes for it. I don't know what to output when emoji is pressed. I've looked online for a…
jelic98
  • 723
  • 1
  • 12
  • 28
2
votes
3 answers

Visual Works smalltalk, how to convert Ascii values to characters

using visualworks, in small talk, I'm receiving a string like '31323334' from a network connection. I need a string that reads '1234' so I need a way of extracting two characters at a time, converting them to what they represent in ascii, and then…
Medic3000
  • 786
  • 4
  • 20
  • 44
2
votes
2 answers

binary input with an ASCII text header, read from stdin

I want to read a binary PNM image file from stdin. The file contains a header which is encoded as ASCII text, and a payload which is binary. As a simplified example of reading the header, I have created the following snippet: #! /usr/bin/env…
Brent Bradburn
  • 51,587
  • 17
  • 154
  • 173
2
votes
1 answer

Number 1 to Z input using def operator

I'm having trouble with this question, and I don't know where to start: Write a function that prints characters using the following header: def printChars(ch1, ch2, numberPerLine): This function prints the characters between ch1 and ch2 with the…
user5129558
1 2 3
99
100