Questions tagged [control-characters]

Control characters are non-printing characters used to send signals to the output terminal.

Control characters are generally non-printing characters that are used to send signals to the output terminal.

More information is available on Wikipedia.

218 questions
646
votes
13 answers

What are carriage return, linefeed, and form feed?

What is the meaning of the following control characters: Carriage return Line feed Form feed
ashna
  • 7,159
  • 4
  • 20
  • 9
56
votes
3 answers

What are the file/group/record/unit separator control characters and their usage?

Unicode defines several control characters from ASCII. http://www.unicode.org/charts/PDF/U0000.pdf I see many control characters are widely used but I really don't see where "information separators" are used. (U+001C~U+001F) What are they? What's…
eonil
  • 83,476
  • 81
  • 317
  • 516
40
votes
3 answers

Finding the Values of the Arrow Keys in Python: Why are they triples?

I am trying to find the values that my local system assigns to the arrow keys, specifically in Python. I am using the following script to do this: import sys,tty,termios class _Getch: def __call__(self): fd =…
Newb
  • 2,810
  • 3
  • 21
  • 35
36
votes
5 answers

Match non printable/non ascii characters and remove from text

My JavaScript is quite rusty so any help with this would be great. I have a requirement to detect non printable characters (control characters like SOH, BS etc) as well extended ascii characters such as Ž in a string and remove them but I am not…
Grant Doole
  • 565
  • 1
  • 4
  • 9
26
votes
5 answers

Why is '\x' invalid in Python?

I was experimenting with '\' characters, using '\a\b\c...' just to enumerate for myself which characters Python interprets as control characters, and to what. Here's what I found: \a - BELL \b - BACKSPACE \f - FORMFEED \n - LINEFEED \r - RETURN \t…
PaulMcG
  • 62,419
  • 16
  • 94
  • 130
24
votes
5 answers

Discretionary line break in HTML?

I'm looking for a way to specify where a line should break if it cannot fit on its line in a way similar to ­ (soft/discretionary hyphen), but with a space. I tried googling it but didn't get many relevant hits (mostly for InDesign despite…
Jakob Jingleheimer
  • 30,952
  • 27
  • 76
  • 126
21
votes
2 answers

What does the "^@" mean in file?

Code: int fd; fd = open("fruit", O_WRONLY); write(fd, "apple", sizeof("apple")); close(fd); I compile it with $ gcc test.c -o test and run as $ ./test Then I open the fruit file, and I see the following in the file: apple^@ What does the ^@…
Ren
  • 2,852
  • 2
  • 23
  • 45
17
votes
4 answers

Java: detect control characters which are not correct for JSON

I am reinventing the wheel and creating my own JSON parse methods in Java. I am going by the (very nice!) documentation on json.org. The only part I am unsure about is where it says "or control character" Since the documentation is so clear, and…
700 Software
  • 85,281
  • 83
  • 234
  • 341
16
votes
5 answers

ASCII control character html input text

I'm trying to process input from a barcode scanner in a javascript browser app. The scanner output is a string of characters, which also contains at least one Group Separator character (ASCII 29). When I direct the input to i.e. notepad++, the…
user2007080
  • 185
  • 3
  • 7
15
votes
1 answer

What is the purpose of Unicode "Backspace" U+0008?

What is the purpose of the Unicode Character 'BACKSPACE' (U+0008) in programming? What applications can it be used for?
skibulk
  • 3,088
  • 1
  • 34
  • 42
15
votes
3 answers

XmlTextWriter incorrectly writing control characters

.NET's XmlTextWriter creates invalid xml files. In XML, some control characters are allowed, like 'horizontal tab' ( ), but others are not, like 'vertical tab' ( ). (See spec.) I have a string which contains a UTF-8 control character that is…
Tom Lokhorst
  • 13,658
  • 5
  • 55
  • 71
15
votes
3 answers

Removing control characters from a UTF-8 string

I found this question but it removes all valid utf-8 characters also (returns me a blank string, while there are valid utf-8 characters plus control characters). As I read about utf-8, there's not a specific range for control characters and each…
Xaqron
  • 29,931
  • 42
  • 140
  • 205
15
votes
3 answers

Remove escape sequence characters like newline, tab and carriage return from JSON file

I have a JSON with 80+ fields. While extracting the message field in the below mentioned JSON file using jq, I'm getting newline characters and tab spaces. I want to remove the escape sequence characters and I have tried it using sed, but it did not…
user3792699
  • 339
  • 3
  • 7
  • 17
15
votes
9 answers

What does PuTTY send when I press Enter key?

I am trying desperately to get a Bluetooth dongle working with my Arduino but I can't send it a command that it needs. I can use it when I plug it into my computer via a USB to UART chip and send the command (C) from PuTTY and then press Enter. The…
Sponge Bob
  • 1,551
  • 5
  • 17
  • 23
12
votes
6 answers

Is there a faster way to clean out control characters in a file?

Previously, I had been cleaning out data using the code snippet below import unicodedata, re, io all_chars = (unichr(i) for i in xrange(0x110000)) control_chars = ''.join(c for c in all_chars if unicodedata.category(c)[0] == 'C') cc_re =…
alvas
  • 115,346
  • 109
  • 446
  • 738
1
2 3
14 15