Questions tagged [ascii]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
44 views

Command similar to ascii for ascii extended and/or for unicode?

ascii command in Linux is fast and great. It allows us to search for a character or for a code point and returns all relevant results for a given search. Is there something similar for ASCII extended (...
demacj's user avatar
  • 3
0 votes
2 answers
246 views

write an ascii extended code to xterm

I can copy and paste text with extended codes into xterm (really xfce4-terminal), and they show up just fine. Piping extended characters to a hex editor shows them just fine for example: " ...
Ray Andrews's user avatar
  • 2,165
2 votes
0 answers
124 views

XTerm: Bitmap font for ASCII, TrueType font for Unicode

I would like to display Chinese characters in the console, with TrueType fonts and normal characters in Bitmap fonts. So far, I have succeeded in displaying: ASCII TrueType, Unicode TrueType (via ...
xascii's user avatar
  • 21
0 votes
1 answer
683 views

is there any way to transfer file in Ascii mode using ftp or sftp

We have a server and we need to transfer file in Ascii mode. While transferring : when we use "ftp" command getting below error Error: 530 Log on attempt by user rejected (530 Secure ...
Arya's user avatar
  • 306
2 votes
1 answer
447 views

ed does not join lines with ASCII text, with CRLF, LF line terminators

I am currently running Gnu ed version 1.18 in the Debian WSL on Windows. If I edit a file with the following encoding: ASCII text, with CRLF, LF line terminators or ASCII text, with CRLF, then ed ...
Edman's user avatar
  • 492
0 votes
2 answers
972 views

iconv cannot convert from ASCII.. why?

I have this file. If I open it in Total Commander with F3 and press S the proper content will be shown. I tried to do the same thing in bash with iconv: iconv -f ASCII -t UTF8 input.txt but I got this:...
user3719454's user avatar
0 votes
1 answer
976 views

Unable to change file encoding to utf-8

I modified a UTF-8 encoded xml file using vi editor and saved it. I'm on Redhat Linux 7.9 I checked the file encoding after the changes and found it to be us-ascii file --mime-encoding tmpfiles/08/...
Ashar's user avatar
  • 489
4 votes
1 answer
624 views

grep a range of characters (decimal encoding)

I have a list of accepted characters: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHI These characters can be translated in the ASCII decimal range 33-73 The implementation I'd like would ...
aechchiki's user avatar
  • 243
2 votes
2 answers
170 views

combine multiple commands like tr, iconv and dd

New to shell scripting, I have few commands like this. Is it optimal to have such temporary files or should I try to combine all these commands ? if it is latter, can you help me to redirect output ...
Ram's user avatar
  • 25
0 votes
1 answer
2k views

what does the following tr command do?

I am looking at a .sh script and one of the lines is the following: tr -d '\15' < file1.txt > /testProject/files/file1.txt i understood the part file1.txt > /testProject/files/file1.txt ...
Amreen Fatema's user avatar
13 votes
1 answer
1k views

Why do ^M and \r behave inconsistently?

Perhaps there are already answers out there that indirectly answer my question, but I've read many of them and haven't yet found a satisfactory answer to this discrepancy. The original meaning of ...
mgarort's user avatar
  • 455
6 votes
3 answers
3k views

How to convert escape sequences to text while preserving display format?

I have a text file that contains (ANSI ?) escape sequences: When I cat the file I get formatted output: How do I save / pipe the output of the text file to a new file so that the control codes are ...
mvanle's user avatar
  • 287
0 votes
0 answers
118 views

Output of command "file <filename>" changes after opening the file with nano?

Background: I'm running a script on a raspberry pi, and the script writes logs to a file. The script take some time to finish so sometimes the pi experiences power outage and shuts down. Whenever this ...
badatmath's user avatar
0 votes
2 answers
63 views

Where can I find the mapping between an ASCII encoding and its visualization?

I like to override the ASCII output in zsh with custom characters. 0x30 wouldn't be then '0' but for example 'Б'. I don't want just to substitute characters, but to change pixels through custom ...
marius's user avatar
  • 1
3 votes
1 answer
416 views

Renaming files with non-ASCII files to append their own datetime in ASCII

Multilingual environment and our file storage on linux of course allows all those international (Asian) characters in filenames. But this is causing problems syncing to other systems because the ...
SSP's user avatar
  • 33
3 votes
2 answers
635 views

Search for filenames containing extended ascii characters

I want to find all filenames in a directory tree that contain extended ASCII characters (0x80-0xFF). I thought that I could do this like this: find . -regex '.*[\x80-\xFF]+.*' but instead it matches ...
Jeff Rice's user avatar
5 votes
2 answers
426 views

How to handle "YouTube filenames" containing arabic, chinese, hindi characters in bash script?

I downloaded many YouTube videos and want to process them using bash scripts. However the filenames used contain all kinds of special and non-ASCII characters. How do I handle this in a bash script? ...
mcExchange's user avatar
0 votes
2 answers
656 views

uniq -i is does not ignore case-sensitive in non-Ascii characters

I have a txt: a.txt A a B b Ş ş I try this command and I get false output: $ uniq -ic a.txt 2 A 2 B 1 Ş 1 ş How can I solve the non-ascii character problem ...
rojen's user avatar
  • 184
4 votes
5 answers
8k views

How to draw a continuous line in terminal?

I've been searching for this for a while and didn't get a satisfactory answer for it. I've taken this screenshot from the output of Gnu/Linux's tree command. I want to know how to draw or print ...
Mahmoud Farouq's user avatar
7 votes
3 answers
2k views

BASH print question (printf \\$(printf '%03o' $1))

I used the following to convert from int to char and char to int in bash. But I do not understand how printf \\$(printf '%03o' $1) or printf '%d' "'$1" work. Please explain how printf \\$(printf '%...
1885's user avatar
  • 131
0 votes
1 answer
3k views

What should ASCII character 26 do?

I have code where I display ANSI art, I've found that last 128 bytes hold SAUCE meta data. The problem I have is just before the SAUCE data there is one character that looks out of place, that is ...
jcubic's user avatar
  • 9,752
1 vote
0 answers
44 views

Padding for a file containing Russian Cyrillic characters in a file not working

I am trying to create a file with fixed column lengths in Unix. The file contains Russian Cyrillic characters and those characters are interpreted different from the normal 1-byte characters. I am ...
Elena's user avatar
  • 11
3 votes
3 answers
16k views

Do files actually contain an End Of File (EOF) character? [duplicate]

The Geostationary Operational Environmental Satellite (GOES)-R Product User Guide (PUG) from the National Oceanic and Atmospheric Administration (NOAA) contains the following rather wordy description ...
gerrit's user avatar
  • 3,487
2 votes
1 answer
232 views

Is there a character that sorts before the newline character, for managing sort order in 'ls'?

I'm developing some file naming guidelines, and I'm trying to find a way to allow a draft document to list before a final revision. Example: Currently my naming convention looks like this: ...
cleary's user avatar
  • 224
0 votes
1 answer
512 views

Bash script to compare ASCII values [closed]

what is the wrong? #!/usr/local/bin/bash REF_FILE_NUM="000000010000001900000052" for id in `ls -1 dir` ; do FILE_NUM=${id:0:24} echo "FILE_NUM: $FILE_NUM ; REF_FILE_NUM: $REF_FILE_NUM" if [[ "$...
Anar's user avatar
  • 9
3 votes
0 answers
3k views

Using iconv to convert utf-8 characters to the closest ASCII character

I can use the iconv command to "translit" a utf-8 string to an ASCII-only string with characters being replaced with their closest ASCII character. However, my problem is that I need the ...
FedKad's user avatar
  • 590
2 votes
2 answers
2k views

Why does awk's printf interpret character values greater than 127 as multi-byte characters?

The ASCII character range is from 0 to 127, and within that range, awk's printf with the %c format specifier outputs one byte of data: $ awk 'BEGIN{printf "%c", 97}' a $ awk 'BEGIN{printf "%c", 127}'...
Sam's user avatar
  • 132
2 votes
2 answers
758 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 ...
user avatar
0 votes
1 answer
374 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 ...
LocalHost's user avatar
  • 489
-1 votes
1 answer
261 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 ...
user avatar
2 votes
1 answer
3k 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 ...
BowPark's user avatar
  • 4,861
2 votes
1 answer
2k 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 ...
HippoMan's user avatar
  • 565
5 votes
1 answer
256 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 ...
LocalHost's user avatar
  • 489
2 votes
1 answer
873 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; ...
CLB's user avatar
  • 31
1 vote
2 answers
1k 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....
Philip Kirkbride's user avatar
16 votes
3 answers
30k 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 ...
Mizole Ni's user avatar
  • 169
1 vote
1 answer
207 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 ...
arnpry's user avatar
  • 125
0 votes
0 answers
518 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" ...
user3768495's user avatar
2 votes
1 answer
1k 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 ...
Chris Stryczynski's user avatar
0 votes
2 answers
2k 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 ...
user28226's user avatar
6 votes
3 answers
4k 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 ...
novelistparty's user avatar
1 vote
1 answer
8k 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 "{\"...
Bernie Lenz's user avatar
-2 votes
4 answers
1k 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 ...
ltstrom's user avatar
-1 votes
1 answer
92 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 ...
Léo Léopold Hertz 준영's user avatar
6 votes
2 answers
5k 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-...
eexpress's user avatar
  • 371
1 vote
3 answers
11k 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 ...
DrPrItay's user avatar
  • 111
-1 votes
1 answer
833 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 ...
Boby Gandhi's user avatar
1 vote
1 answer
442 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 ...
Léo Léopold Hertz 준영's user avatar
21 votes
3 answers
51k 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 ...
user628544's user avatar
  • 1,525
1 vote
1 answer
457 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?
Austin's user avatar
  • 221