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.

198 questions
564
votes
12 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
  • 6,239
  • 4
  • 17
  • 9
43
votes
2 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
  • 75,400
  • 74
  • 294
  • 482
31
votes
2 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,454
  • 2
  • 18
  • 31
30
votes
4 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
  • 451
  • 1
  • 4
  • 8
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
  • 56,194
  • 14
  • 81
  • 122
22
votes
4 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
  • 29,050
  • 22
  • 73
  • 121
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,488
  • 1
  • 15
  • 36
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
  • 26,135
  • 39
  • 130
  • 194
15
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
  • 77,509
  • 74
  • 213
  • 324
14
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
  • 12,397
  • 5
  • 50
  • 69
14
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,185
  • 4
  • 14
  • 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
  • 94,813
  • 90
  • 365
  • 641
11
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
  • 2,768
  • 30
  • 39
11
votes
3 answers

cscript - print output on same line on console?

If I have a cscript that outputs lines to the screen, how do I avoid the "line feed" after each print? Example: for a = 1 to 10 WScript.Print "." REM (do something) next The expected output should be: .......... Not: . . . . . . . . . . In…
Guy
  • 9,125
  • 7
  • 35
  • 42
10
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
  • 125
  • 2
  • 7
1
2 3
13 14