special-characters

What is a vertical tab?

放肆的年华 提交于 2019-12-17 10:13:13
问题 What was the original historical use of the vertical tab character ( \v in the C language, ASCII 11)? Did it ever have a key on a keyboard? How did someone generate it? Is there any language or system still in use today where the vertical tab character does something interesting and useful? 回答1: Vertical tab was used to speed up printer vertical movement. Some printers used special tab belts with various tab spots. This helped align content on forms. VT to header space, fill in header, VT to

Change foreign characters to their roman equivalent

∥☆過路亽.° 提交于 2019-12-17 07:21:46
问题 I am using php and I was wondering if there was a predefined way to convert foreign characters to their non-foreign alternatives. Characters such as ê, ë, é all resulting to 'e' . I'm looking for a function that would take a string and return it without the special characters. Any ideas would be greatly appreciated! 回答1: After failing to find suitable convertors I created my own collection that suits my needs including my favorite Cyrillic conversion that by default has numerous variations.

Escape field name in jq that contains '@' and '-'? [duplicate]

家住魔仙堡 提交于 2019-12-17 06:55:10
问题 This question already has an answer here : How to use jq when the variable has a period (1 answer) Closed last year . Input JSON: { "abc": { "@def-ghi": "value1", "xyz": "value2" } } And I'm trying to get value for field @def-ghi . ➜ $?=0 ➤ echo '{"abc": {"@def-ghi": "value1", "xyz": "value2"}}' | jq '.abc.xyz' "value2" ➜ $?=0 ➤ echo '{"abc": {"@def-ghi": "value1", "xyz": "value2"}}' | jq '.abc.@def-ghi' jq: error: syntax error, unexpected '-', expecting QQSTRING_START (Unix shell quoting

How to write character & in android strings.xml

試著忘記壹切 提交于 2019-12-17 04:12:28
问题 I wrote the following in the strings.xml file: <string name="game_settings_dragNDropMove_checkBox">Move by Drag&Drop</string> I got the following error: The reference to entity "Drop" must end with the ';' delimiter. How can I write character & in the strings.xml? 回答1: Encode it: & 回答2: For special character I normally use the Unicode definition, for the '&' for example: \u0026 if I am correct. Here is a nice reference page: http://jrgraphix.net/research/unicode_blocks.php?block=0 回答3: This

Identifying and removing null characters in UNIX

点点圈 提交于 2019-12-17 03:24:35
问题 I have a text file containing unwanted null characters (ASCII NUL, \0 ). When I try to view it in vi I see ^@ symbols, interleaved in normal text. How can I: Identify which lines in the file contain null characters? I have tried grepping for \0 and \x0 , but this did not work. Remove the null characters? Running strings on the file cleaned it up, but I'm just wondering if this is the best way? 回答1: I’d use tr : tr < file-with-nulls -d '\000' > file-without-nulls If you are wondering if input

WebClient.DownloadString() returns string with peculiar characters

天大地大妈咪最大 提交于 2019-12-17 02:49:06
问题 I have an issue with some content that we are downloading from the web for a screen scraping tool that I am building. in the code below, the string returned from the web client download string method returns some odd characters for the source download for a few (not all) web sites. I have recently added http headers as below. Previously the same code was called without the headers to the same effect. I have not tried variations on the 'Accept-Charset' header, I don't know much about text

Check if a String contains a special character

耗尽温柔 提交于 2019-12-17 02:44:20
问题 How do you check if a String contains a special character like: [,],{,},{,),*,|,:,>, 回答1: Pattern p = Pattern.compile("[^a-z0-9 ]", Pattern.CASE_INSENSITIVE); Matcher m = p.matcher("I am a string"); boolean b = m.find(); if (b) System.out.println("There is a special character in my string"); 回答2: You can use the following code to detect special character from string. import java.util.regex.Matcher; import java.util.regex.Pattern; public class DetectSpecial{ public int getSpecialCharacterCount

Enter “&” symbol into a text Label in Windows Forms?

纵饮孤独 提交于 2019-12-17 02:29:39
问题 How would one enter special characters into a Label in C# (Windows Forms)? If you try to write a "&" into a label you'll get a sort of underscore instead.. So what's the C# equivalent of "&"? ("\&" obviously doesn't work). 回答1: Two ways: Escape it with another ampersand ( && ). Set UseMnemonic for that label to false . This causes all ampersands within the text to be taken literally so you don't need to double any of them. You'll lose the underlining and access key features though. You can

In PHP when submitting strings to the database should I take care of illegal characters using htmlspecialchars() or use a regular expression?

為{幸葍}努か 提交于 2019-12-16 19:40:28
问题 I am working on a form with the possiblity for the user to use illegal/special characters in the string that is to be submitted to the database. I want to escape/negate these characters in the string and have been using htmlspecialchars(). However, is there is a better/faster method? 回答1: If you submit this data to the database, please take a look at the escape functions for your database. That is, for MySQL there is mysql_real_escape_string. These escape functions take care of any characters

special Characters in Perl

不羁的心 提交于 2019-12-16 18:03:24
问题 I'm creating a CGI form to update a Sybase stored procedure. qq {execute procedure test(123,45,date,'$note');}; the $note variable is information obtained from a textbox that contains trouble ticket log information. As such people who enter such information can, and most likely will use special characters such as '|"{} etc. Im curious to know if there is a way to get this information into the database via the variable $note . Most of my research has produced DBI->quote() functions, but they