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
3 answers

Convert binary files into ascii in Python

I have a bunch of binary files that contain data in the following format:…
GobiasKoffi
  • 4,014
  • 14
  • 59
  • 66
2
votes
0 answers

Converting ASCII to CSV using SAS Load File

I am trying to use a database for biosciences research. The database comes in a few files each ~ 3 gigabyte .ASC files. The corporation that uses it provides an SAS load file that can be found here. My question is is there a way to use this ASCII…
Pavan
  • 93
  • 5
2
votes
2 answers

What is the difference between " ’ " and " ' "

For some reason Redcarpet markdown renders ' as ' while rendering ’ as ’. Are there two types of single quote? Why would Redcarpet treat one differently than the other. (Ascii table seems to have one, but under unicode I'm assuming there are…
Reza Shirazian
  • 2,303
  • 1
  • 22
  • 30
2
votes
2 answers

How to check whether a substring are of ascii+latin characters and pad the ascii/latin characters substring with spaces?

Given a string like this: 顺便采买些喜欢的CD和DVD或vcd。 The desired output is: 顺便采买些喜欢的 CD 和 DVD 或 vcd 。 I've tried looking through each character and checking whether the character before and after is an ascii, and using the following conditions decide…
alvas
  • 115,346
  • 109
  • 446
  • 738
2
votes
1 answer

pyHook giving wrong ASCII values

I was working on a keylogger to learn a bit about pyHook, but it seems like event.Ascii gives me the wrong ASCII values. For example I get 0 for any symbol or number, 1 for A (should be 65), etc. import pyHook, pythoncom def…
2
votes
1 answer

(C) Program that prints all CP850 characters on the screen and in a file have different outputs

The program is pretty simple, it helped me get all the ascii codes since my computer doesn't seem to follow the standards in the interwebs. The problem I'm finding is that the outputs on the file and on the cmd differ. I need to use the box…
Bernasss12
  • 29
  • 2
2
votes
1 answer

Translation and mapping of emoticons encoded as UTF-8 code in text

I am working with text which includes emoticons. I need to be able to find these and replace them with tags which can be analysed. How to do this? > main$text[[4]] [1] "Spread d wrd\xf0\u009f\u0098\u008e" > grepl("\xf0", main$text[[4]]) [1] FALSE I…
stochastic13
  • 423
  • 2
  • 15
2
votes
2 answers

Cmd to powershell replace - special character

I am creating a script that will copy a file, rename it and then look inside to remove certain special characters. One of these special characters is some sort of ASCII apostrophe that I cannot replicate with keys. I can copy and paste it though,…
meeilz
  • 23
  • 1
  • 4
2
votes
1 answer

Reading from a binary file in MIPS

I have a PGM photo which I'm trying to open and read in MIPS. When the values inside the PGM file are ASCII, everything works as expected. When they are in HEX format, the syscall 14 (read) reads just couple of values and than stops and I end up…
boozi
  • 468
  • 1
  • 3
  • 16
2
votes
2 answers

Fastest/most optimized way to read/write ASCII file in python

Let me update my question, I have an ascii file(7G) which has around 100M lines. I read this file using : f=np.loadtxt(os.path.join(dir,myfile),delimiter=None,skiprows=0) x=f[:,1] y=f[:,2] z=f[:,3] id=f[:,0] I will need the x,y,z and id…
Heli
  • 159
  • 1
  • 3
  • 10
2
votes
2 answers

ASCII code for key "arrow down" to use in robot with selenium2library

please, what is the ASCII code for key "arrow down" and "arrow up" that can be used with keyword "PRESS KEY" in robot framework using selenium2library? I searched many threads, tried many combinations (25, 40, and a lot more) but nothing really…
neliCZka
  • 945
  • 1
  • 16
  • 27
2
votes
3 answers

I want to get the next incremented value of 9 (which is 10 of course) but it returns an ASCII code

I was working on a property file. On it, I have an key which is "user_email" and the value, I set it to toomeuser0@gmail.com. Now, in my code, I want the email value to iterate whenever my program runs, so toomeuser0@gmail.com will be…
Jong Onin
  • 215
  • 1
  • 5
  • 12
2
votes
3 answers

Ascii encoding error during sending a mail

I am new to python and trying to receive and resend an email using poplib and smtplib: messages = [pop_conn.retr(i)[1] for i in range(1, mail_count + 1)] #decode messages messages = [[line.decode("utf-8") for line in message] for message…
user6216224
2
votes
1 answer

Python 'ascii' codec can't encode character with request.get

I have a Python program which crawls data from a site and returns a json. The crawled site has the meta tag charset = ISO-8859-1. Here is the source code: url = 'https://www.example.com' source_code = requests.get(url) plain_text =…
Jobeso
  • 653
  • 1
  • 9
  • 11
2
votes
4 answers

Python: UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 0: ordinal not in range(128)

I'm currently have an issue with my python 3 code. replace_line('Products.txt', line, tenminus_str) Is the line I'm trying to turn into utf-8, however when I try to do this like I would with others, I get errors such as no attribute ones and when…
Name not Found
  • 69
  • 2
  • 2
  • 10