control-characters

Apply control characters to a string - Python

对着背影说爱祢 提交于 2019-12-07 07:51:27
问题 I'm trying to apply control characters, such as '\x08 \x08' that should remove the precedent char, to a string (move backwards, write space, move backwards) For example when I type into python console : s = "test\x08 \x08" print s print repr(s) I get in my terminal : tes 'test\x08 \x08' I'm looking for a function, let's says "function", that will 'apply' control characters to my string : v = function("test\x08 \x08") sys.stdout.write(v) sys.stdout.write(repr(v)) so I get a "clean", control

Missing flow control data (0x13) from reading device data stream

有些话、适合烂在心里 提交于 2019-12-06 21:33:32
I have written a Linux app to read & write binary data to a remote device over a USB port that is emulating a serial port. When I read data from the device, I have a USB sniffer that shows a binary data stream like this (0x01, 0x0A......0x13), but when my program reads the bytes, the 0x13 is not in the byte stream - this is the XOFF char, but I am not using XON/XOFF flow control (I think). Tried both open read and write, as well as fopen fread and fwrite in binary mode, same result. Any ideas? Thanks for any responses, like the website. Turns out stty showed: # stty -F /dev/ttyUSB0 speed

Removing binary control characters from a text file

扶醉桌前 提交于 2019-12-06 08:23:41
I have a text file that contains binary control characters, such as "^@" and "^M". When I try to perform string operations directly on the text file, the control characters crash the script. Through trial and error, I discovered that the more command will strip the control characters so that I can process the file properly. more file_with_control_characters.not_txt > file_without_control_characters.txt Is this considered a good method, or is there a better way to remove control characters from a text file? Does more have this behavior in OSes earlier than Windows 8? Certainly you do not want

What does PuTTY send when I press Enter key?

喜你入骨 提交于 2019-12-05 19:04:27
问题 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 Bluetooth dongle's command sheet says that the command I am trying to send it C<cr> but I can't figure out how to send the proper carriage return character from the Arduino code. I have tried using the Serial.println() function as well as adding

How To read control characters in a pdf using java

南笙酒味 提交于 2019-12-04 22:48:57
I'm using PDFBox to read PDF files. But some characters are not printing well and printing like control characters. Some one help to read the values from the control characters. I've attached the image Kindly have a look at that image Sample PDF: Screenshot: Sample Code class PDFManager { private PDFParser parser; private PDFTextStripper pdfStripper; private PDDocument pdDoc ; private COSDocument cosDoc ; private String Text ; private String filePath; private File file; public PDFManager() { } public String ToText() throws IOException { this.pdfStripper = null; this.pdDoc = null; this.cosDoc =

Discretionary line break in HTML?

荒凉一梦 提交于 2019-12-04 00:49:31
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 specifying "html"), and what I did get was a few people saying they didn't know of a way. Ex. Hello, my name is foo. vs. Hello, my name is foo. but if space is available: Hello, my name is foo. For specificity, I do not mean white-space: normal/nowrap/pre/… and I don't want to force a break like with <br /> . I'm using AngularJS, so most everything is

Java: detect control characters which are not correct for JSON

有些话、适合烂在心里 提交于 2019-12-03 15:54:24
问题 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 JSON is so simple and easy to implement, I thought I would go ahead and require the spec instead of being loose. How would I correctly strip out control characters in Java? Perhaps there is a unicode range? Edit: A (commonly?) missing peice to the

What is the purpose of Unicode “Backspace” U+0008?

不羁的心 提交于 2019-12-03 06:20:47
What is the purpose of the Unicode Character 'BACKSPACE' (U+0008) in programming? What applications can it be used for? Um, it's a backspace character. On output to a terminal, it typically moves the cursor one position to the left (depending on settings). On input, it typically erases the last entered character (depending on the application and terminal settings), though the DEL / DELETE character is also used for this purpose. Typically it can be entered by pressing Backspace or Control-H Note that its action of deleting characters occurs only on a display, not in memory. A string within a

Java: detect control characters which are not correct for JSON

亡梦爱人 提交于 2019-12-03 05:19:55
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 JSON is so simple and easy to implement, I thought I would go ahead and require the spec instead of being loose. How would I correctly strip out control characters in Java? Perhaps there is a unicode range? Edit: A (commonly?) missing peice to the puzzle I have been informed that there are other control characters outside of the defined range 1 2 that

What's the file/group/record/unit separator control characters and its usage?

核能气质少年 提交于 2019-12-02 21:07:42
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 them? What's the history of them? Where did they used for? Jonas Elfström Lammert Bies explains both their usage and the history behind. 28 – FS – File separator The file separator FS is an interesting control code, as it gives us insight in the way that computer technology was organized in the sixties. We are now used to random access media like RAM and magnetic