Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [ascii]

An acronym of American Standard Code for Information Interchange, a well-known character encoding set.

1
vote
1answer
63 views

How do I save image produced by asciiview?

When I run command asciiview image.jpg I'm able to view image in the terminal and quit browser using q key. I've tried different ways to redirect the output of the asciiview image.jpg to the console ...
0
votes
1answer
57 views

printf and echo -e are giving different results

I am using \0n escape sequence with echo -e and printf where n is the octal value of the ASCII character to be printed. When i used the statement echo -e "\0101" the shell is printing character A but ...
-1
votes
1answer
26 views

How do we get the readable string from big endian hex string

How do we get the readable string from hex string 0049006e00740072006f of BE which means as normal word, ie. we dont have to swap the byte pair per word tried with xxd in vain, cause I dont know ...
0
votes
1answer
70 views

Distinguish ascii from UTF-8 characters in the same file

On Ubuntu 18.04, I created a dummy text file with just one UTF-8 character, è. The other characters are all ascii: $ cat dummytext Hello Helloè This is the resulting hexdump: $ hexdump -C dummyfile ...
2
votes
1answer
59 views

Disabling utf-8 in all terminals?

This question pertains to my Ubuntu 18 system, as follows ... % uname -a Linux myhost.name.net 4.15.0-45-generic #48-Ubuntu SMP Tue Jan 29 16:28:13 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux I don't ...
0
votes
0answers
60 views

Set default file encoding to ASCII?

Years ago, most text editing applications had the option to set the default file encoding to US-ASCII. Now I can't find any recent editor on Linux that allows you to choose ASCII. If the purpose is to ...
5
votes
1answer
51 views

%c formatted string shows different behaviour in the shell and in C

If i write a very simple line of code in C: printf("Ascii char for %d is %c\n",65,65); It simply prints A, as ascii value of 65 corresponds to character A. But if I use the same code in shell and ...
0
votes
0answers
44 views

Creating Plain Text MAN Pages: Removing overstrike characters [duplicate]

I want to create plain text files of certain man pages such as the "ls" command. Simply performing a man ls > ls.txt, and then running file ls.txt will inform me that this is full of 'ASCII text, ...
1
vote
1answer
134 views

Hex code for '(' in bash regex

I have a strange behaviour in shell. When I try to match '_' in regex with its hex code it works, but not with '('. $ regex1=$'\x5f' $ pattern1='_' $ if [[ $pattern1 =~ $regex1 ]]; then echo yes; ...
0
votes
1answer
224 views

Embed ascii diagram in groff?

I have groff file to generate a pdf in the format: .TL Article title .AU Author name .AI Publication title .SH .LP First paragraph .PP More paragraphs I'm then running groff -ms a.ms -T pdf > a....
10
votes
3answers
6k views

Removing all non-ascii characters from a workflow (file)

How would I remove all non-ascii characters from one file? Would there be a specific command to perform this? grep --colour='auto' -P -n'[^\x00-\x7]' /usr/local/... I believe this finds the ...
0
votes
1answer
61 views

Interpolate Columnar Data

I am trying to find a way to interpolate between two lines of data in a CSV file, likely using awk. Right now, each line represents a data point at Hour 0 and Hour 6. I am looking to fill in missing ...
0
votes
0answers
59 views

file command gives incorrect encoding type

I have a csv file in hand. When I ran 'file -i filename', it shows that it's encoded as us-ascii. But when I ran cat filename | csvcut -t -e us-ascii, I got an error: "Your file is not "us-ascii" ...
2
votes
2answers
113 views

How to generate a ascii char in a string with Bash / ZSH correctly?

I'm trying to generate a string of 10 followed by a NULL (\0) followed by a 10. However echo "10\010" does not seem to work (I'm guessing it generates two chars - a 10 followed by \010. I'm not sure ...
0
votes
1answer
370 views

Replacing non printable characters with hex numerical values

I have a badly corrupted Sqlite file The usual trick of dumping everything into a sql file and loading it into a fresh file doesn't work, but with a hex editor I can see that the data I need to ...
4
votes
3answers
794 views

Are ASCII escape sequences and control characters pairings part of a standard?

There are common pairings of escape sequences to ASCII control characters, such as Ctrl-C and Ctrl-Z to ETX and SUB, respectively. On the Wikipedia Control Codes page, there are most pairings, but no ...
0
votes
1answer
2k views

curl with Umlaut causes “JSON parse error: Invalid UTF-8 middle byte 0x22” [duplicate]

I'm running below curl command from the command line (Git Bash on Windows) or as part of a Bash Script. curl -s -X POST -H "Content-Type: application/json" -H "Accept: application/json" -d "{\"...
-2
votes
3answers
335 views

Bash Cat file to terminal centre

I have a text file with aome ascii art in it. I am trying to get it to print to the terminal on terminal start. I know to do this i add cat myfi in my .bashrc. i am stuck trying to get the output of ...
0
votes
1answer
50 views

Why Gedit's hash symbol is expanded and interpreted wrongly in internet browsers?

I copy-paste Gedit-hash (#) in a part of filepath into internet browser to read PDF file unsuccessfully: no file found with Gedit-hash symbol. Inputing there directly the hash symbol from the ...
2
votes
1answer
1k views

Want “tree” output utf8

▶ tree 下载 -L 1 \344\270\213\350\275\275 ├── BT ├── ISO ├── Let\ s\ Play\ -\ Sniper\ Elite\ v2\ Nazi\ Zombie\ Army.flv ├── sniper\ elite\ v2\ 02.flv └── \350\275\257\344\273\266\345\214\205 those 7-...
1
vote
3answers
4k views

Inputting extended ascii values

Hey so I'm losing my mind over this, I have some program written in c that gets some string as an input directly from terminal then prints the ascii value of each byte entered within the string, I'm ...
-1
votes
1answer
494 views

what is ascii 7-bit character set and ascii 8-bit character set?

Im new to this, so ascii 7 bit can represent 128 values, then ascii 8 can represent 256 values? this right? ascii 7-bit character set: 01000001 represents ‘A’ how would a look like in ascii 8 bit? or ...
1
vote
1answer
219 views

How to find non-British non-ASCII non-LaTeX characters for pdftex?

I am debugging my tex file by eliminating all technical flaws in the systems. I cannot find anything wrong in my document with Tex community here and myself so I think there can be something non-ASCII ...
6
votes
3answers
12k views

Difference between EOT and EOF

I understand that EOT is ASCII code 4, whereas EOF is encoded as -1 (at least in C). Before I found out that EOF is mapped to -1, I thought it was just a synonym for EOT. Why is EOF mapped to -1 ...
1
vote
1answer
286 views

Entering ascii chars as program input

If I write a very simple C terminal program that takes an input, how can I enter an ascii character as the input, like for instance the backspace character?
2
votes
3answers
1k views

How to determine the character encoding that a terminal uses in a C/C++ program?

I've noticed that SyncTERM uses a different character encoding than the default MacOS terminal emulator, and they're incompatible with one another. For example, say you want to print a block ...
2
votes
1answer
342 views

Why won't chfn allow non-ascii chars or equal signs? [closed]

I'm wondering what the historical purpose is of designing chfn command to warn people over the use of non-ASCII symbols, (and why only enforce it for phone numbers?) Is this something that still ...
0
votes
1answer
460 views

Does gzip removes ASCII values

I have a txt file in which i have multiple ASCII values.Like the below one which is the example : including complimentary high-speed internet access, in-room hospitality center with microwave, ...
1
vote
4answers
693 views

Keystrokes for ASCII control codes

Okay, so I've recently realized the correspondence between Control keystrokes and ASCII control codes, e.g. ^D sends the EOT character because EOT is ASCII code 4 and D is the fourth letter in the ...
9
votes
6answers
19k views

How do I print an ASCII character by different code points in Bash?

In the ASCII table the 'J' character exists which has code points in different numeral systems: Oct Dec Hex Char 112 74 4A J It's possible to print this char by an octal code point by ...
1
vote
1answer
200 views

locate outputs question marks when locatedb contains certain characters (tabs) unless output is piped

I construct my own locatedb using frcode so it would contain filesizes after paths (it helps me look for large files quickly). I store the path separated from the size by a tab character. I've noticed ...
1
vote
1answer
415 views

store file with invalid characters

Some files we get from a customer could not be processed properly because they were declared as US-ASCII but contained invalid characters. In order to validate a software fix, I am trying to copy ...
19
votes
2answers
4k views

Why doesn't the Enter key send EOL?

Unix / Linux EOL is LF, linefeed, ASCII 10, escape sequence \n. Here's a Python snippet to get exactly one keypress: import sys, tty, termios fd = sys.stdin.fileno() old_settings = termios.tcgetattr(...
1
vote
2answers
78 views

ERROR: integer expression expected - comparing tables

I have a small bash program, that allows me to compare tables (having similar naming style) and that copies to another directory the file having the highest value at the first row of the fourth column ...
0
votes
1answer
134 views

Display non-printable parameters in running processes

ps aux displays commands running on the server, but it does not display non-printable parameters in any sort of way that is useful. mycmd.sh: #!/bin/bash while true do sleep 5 done ...
2
votes
2answers
756 views

How to convert an special hex character from an html page in bash? [duplicate]

I have a script which process some information coming from a web page. I guess that because of the encoding of the page, some special characters are encoded in hexadecimal. For example, I have the the ...
1
vote
1answer
465 views

What happens when I echo with `-e` argument?

As you can see, I have created index.php as follows: $ echo -e "<?php passthru(\$_POST[1])?>\r<?php echo 'A PHP Test ';" > index.php and then: $ cat index.php <?php echo 'A PHP Test '...
0
votes
1answer
7k views

blessdiff for the “full featured hexadecimal editor”?

I am trying to find some hex diftool which allows me to compare to documents in the view but also the internal differences like in bless so two bless windows side-by-side but with diff capability ...
3
votes
4answers
8k views

How to produce a CR/LF in linux text docs? [closed]

How do you produce a CR/LF anywhere in a text document created in linux OS so that it can be copied and pasted into a windows text editor or onto the web and retain the CR/LF to be read and acted upon ...
3
votes
3answers
96 views

printing a series of characters

My ultimate goal here is to generate a block of text that can be used to test out various fonts at a terminal. I want to generate the file as basically an ascii chart. A series of characters from 1 ...
1
vote
0answers
1k views

USB bar code scanner not working on Raspbian

My USB bar code scanner (SYMBOL LS2208) is recognized as a HID. hid-generic 0003:05E0:0600.000F: hiddev0,hidraw0: USB HID v1.10 Device [\xffffffef\xffffffbe\xffffffa9\xffffffbe\xffffffa9Symbol ...
1
vote
4answers
2k views

How to recognize which ASCII character in hex is this?

We have a textfile that we want to clear from "bad" characters. If we open it with vim (with ":set number"): 57000044 zo¥<9a>¥ge¥o¥graph¥i¥cal¥ly 39999999 pariá¹<83>Å<9b>a The ex.:...
1
vote
1answer
2k views

Convert serialized Java object to human readable

I have object of class class X { private DateTime dt; "constructor, set/get" } I have one instance of this object serialized in file.bin. I want to show content of `file.bin on the Linux ...
1
vote
2answers
2k views

Conversion of plain-text files from ASCII to Unicode without any command

Why are ASCII-encoded files extended to UTF-8 or in reverse reduced to ASCII? user:~$ echo 'A B C | } ~' > ./file user:~$ user:~$ file --brief --mime ./file text/plain; charset=us-ascii ...
1
vote
1answer
19k views

Converting a file from ASCII to Binary

I have a series of files that are either delimited and fixed width, containing many rows of both character and numeric values like so (delimited example): Smith,Audrey,Ford,2000,21300.99 Miller,Heath,...
5
votes
2answers
3k views

Generating file with ASCII numbers using /dev/urandom?

How can I generate 10 MB files from /dev/urandom filled with: ASCII 1s and 0s ASCII numbers between 0 and 9
2
votes
1answer
3k views

Removing non-printable characters using POSIX sed

Files created with roff and other "old-school" tools (for example man pages on many Unix systems) generate bold and underlined text in minimalistic terminals using tricks involving non-printable ASCII ...
0
votes
1answer
2k views

set the default keyboard type to ascii mode

I am running CentOS 6.5 and I am having problems setting the default keyboard mode to ascii for the virtual terminals. Currently, only the system console defaults to ascii mode, but if I log in to an ...
16
votes
3answers
22k views

Why is the unit separator (ASCII 31) invisible in terminal output?

The unit separator ASCII character (ASCII 31, octal 37), is visible in Vim as a ^_. But if I print the same file to the terminal, the character is invisible. This causes the fields on a line to get ...
40
votes
2answers
26k views

“tree” command output with “pure” (7-bit) ASCII output

The "tree" command uses nice box-drawing characters to show the tree but I want to use the output in a "code-page-neutral" context (I know that really there's always a code page, but by restricting it ...