control-characters

ASCII control character html input text

狂风中的少年 提交于 2020-05-10 04:19:12
问题 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 input is displayed correctly including the Group Separator characters. When I direct the input into a <input type="text"> html field, the Group Separator objects are lost; it's neither visible in the field, nor detectable with javascript code. Does the

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

青春壹個敷衍的年華 提交于 2020-01-14 03:40:08
问题 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

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

╄→尐↘猪︶ㄣ 提交于 2020-01-12 04:48:08
问题 What is the purpose of the Unicode Character 'BACKSPACE' (U+0008) in programming? What applications can it be used for? 回答1: 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

Removing control characters from a UTF-8 string

我的未来我决定 提交于 2020-01-11 04:30:48
问题 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 character set has its own control characters . How can I modify above solution to only remove control characters ? 回答1: I think the following code will work for you: public static string RemoveControlCharacters(string inString) { if (inString == null

Unexpected behavior with a string stored in a variable in PowerShell

纵然是瞬间 提交于 2019-12-30 12:14:40
问题 I'm getting some odd behavior from Excel's Cells.Find() method: Variable I'm searching on: PS > $volumename vol_01 PS > $volumename.GetType() IsPublic IsSerial Name BaseType -------- -------- ---- -------- True True String System.Object produces no results: PS > $sheet.Cells.Find($volumename).Row but if I manually copy and paste the value of that variable: PS > $volumename = "vol_01" PS > $volumename.GetType() IsPublic IsSerial Name BaseType -------- -------- ---- -------- True True String

TYPE command stops on 0x1A, except when piped to MORE?

醉酒当歌 提交于 2019-12-24 08:48:53
问题 If I have a binary file with the following contents: 48 65 6C 6C 6F 1A 48 65 6C 6C 6F Then when I run the TYPE command on it, it stops reading at the 1A character: C:\Temp>type file.bin Hello However, when I run TYPE again but this time pipe the output to MORE, it produces the following output: C:\Temp>type file.bin|more Hello→Hello C:\Temp> Which is more representative of the actual contents of the file than the previous command. What exactly does piping output to MORE do that makes it print

0x202A in filename: Why?

萝らか妹 提交于 2019-12-24 00:58:36
问题 I recently needed to do a isnull in SQL on a varbinary image. So far so (ab)normal. I very quickly wrote a C# program to read in the file no_image.png from my desktop, and output the bytes as hex string. That program started like this: byte[] ba = System.IO.File.ReadAllBytes(@"‪D:\UserName\Desktop\no_image.png"); Console.WriteLine(ba.Length); // From here, change ba to hex string And as I had used readallbytes countless times before, I figured no big deal. To my surprise, I got a

How to bulk insert from CSV when some fields have new line character?

梦想与她 提交于 2019-12-22 08:17:53
问题 I have a CSV dump from another DB that looks like this (id, name, notes): 1001,John Smith,15 Main Street 1002,Jane Smith,"2010 Rockliffe Dr. Pleasantville, IL USA" 1003,Bill Karr,2820 West Ave. The last field may contain carriage returns and commas, in which case it is surrounded by double quotes. And I need to preserve those returns and commas. I use this code to import CSV into my table: BULK INSERT CSVTest FROM 'c:\csvfile.csv' WITH ( FIELDTERMINATOR = ',', ROWTERMINATOR = '\n' ) SQL

cscript - print output on same line on console?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-22 04:11:45
问题 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 the past I've used to print the "up arrow character" ASCII code. Can this be done in cscript? ANSWER Print on the same line, without the extra CR/LF for a=1 to 15 wscript.stdout.write a wscript.stdout.write chr(13) wscript.sleep 200 next 回答1: Use WScript

Discretionary line break in HTML?

孤者浪人 提交于 2019-12-21 07:04:13
问题 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/…