Questions tagged [special-characters]

Special characters (as they apply to programming) are language-specific reserved characters or symbols used to accomplish a specific task (e.g. wildcard characters, data type indicators, escape characters, etc).

Every character is special in its own way. When talking about "special characters" in a question, be specific. Do you mean ASCII symbols, Japanese kana, or Egyptian hieroglyphs?

For example, when working with Unicode, characters from exotic scripts aren't more "special", technically, than characters from the ASCII range. If you mean characters that you can't enter directly with an US PC keyboard, you should probably use the term "non-ASCII characters" and avoid this tag.

4617 questions
527
votes
7 answers

Insert text with single quotes in PostgreSQL

I have a table test(id,name). I need to insert values like: user's log, 'my user', customer's. insert into test values (1,'user's log'); insert into test values (2,''my users''); insert into test values (3,'customer's'); I am getting an error…
MAHI
  • 7,205
  • 10
  • 34
  • 46
464
votes
12 answers

How to write character & in android strings.xml

I wrote the following in the strings.xml file: Move by Drag&Drop I got the following error: The reference to entity "Drop" must end with the ';' delimiter. How can I write character & in…
Palo
  • 10,049
  • 7
  • 24
  • 32
263
votes
8 answers

Remove all special characters with RegExp

I would like a RegExp that will remove all special characters from a string. I am trying something like this but it doesn’t work in IE7, though it works in Firefox. var specialChars = "!@#$^&%*()+=-[]\/{}|:<>?,."; for (var i = 0; i <…
Timothy Ruhle
  • 6,437
  • 10
  • 38
  • 61
263
votes
9 answers

What is the difference between \r and \n?

How are \r and \n different? I think it has something to do with Unix vs. Windows vs. Mac, but I'm not sure exactly how they're different, and which to search for/match in regexes.
Sam Lee
  • 8,493
  • 15
  • 44
  • 54
244
votes
10 answers

What is a vertical tab?

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…
dmazzoni
  • 12,008
  • 4
  • 35
  • 34
239
votes
7 answers

Which characters need to be escaped when using Bash?

Is there any comprehensive list of characters that need to be escaped in Bash? Can it be checked just with sed? In particular, I was checking whether % needs to be escaped or not. I tried echo "h%h" | sed 's/%/i/g' and worked fine, without escaping…
fedorqui 'SO stop harming'
  • 228,878
  • 81
  • 465
  • 523
209
votes
8 answers

Meaning of $? (dollar question mark) in shell scripts

What does echo $? mean in shell programming?
Harshay Buradkar
  • 2,293
  • 2
  • 13
  • 18
190
votes
12 answers

Remove all special characters except space from a string using JavaScript

I want to remove all special characters except space from a string using JavaScript. For example, abc's test#s should output as abcs tests.
nithi
  • 2,965
  • 2
  • 16
  • 18
176
votes
9 answers

How do I add a bullet symbol in TextView?

I have a TextView and I want to add a bullet symbol in my text through XML. Is it possible?
Pria
  • 2,453
  • 4
  • 24
  • 30
163
votes
6 answers

Allowed characters in filename

Where can I find a list of allowed characters in filenames, depending on the operating system? (e.g. on Linux, the character : is allowed in filenames, but not on Windows)
python dude
  • 6,960
  • 10
  • 36
  • 53
159
votes
10 answers

Get Character value from KeyCode in JavaScript... then trim

This is what I have now: $("input").bind("keydown",function(e){ var value = this.value + String.fromCharCode(e.keyCode); } If the e.keyCode may not be an ASCII character (Alt, backspace, del, arrows, etc.)... I would now need to trim these…
David Murdoch
  • 82,194
  • 38
  • 141
  • 186
135
votes
12 answers

Converting Symbols, Accent Letters to English Alphabet

The problem is that, as you know, there are thousands of characters in the Unicode chart and I want to convert all the similar characters to the letters which are in English alphabet. For instance here are a few…
AhmetB - Google
  • 35,086
  • 32
  • 117
  • 191
124
votes
21 answers

How do I block or restrict special characters from input fields with jquery?

How do I block special characters from being typed into an input field with jquery?
Nerd Stalker
  • 1,249
  • 2
  • 9
  • 4
122
votes
5 answers

List of special characters for SQL LIKE clause

What is the complete list of all special characters for a SQL (I'm interested in SQL Server but other's would be good too) LIKE clause? E.g. SELECT Name FROM Person WHERE Name LIKE '%Jon%' SQL Server: % _ [specifier] E.g. [a-z] [^specifier] ESCAPE…
Jonathan Parker
  • 6,497
  • 3
  • 38
  • 54
116
votes
5 answers

How should I escape commas and speech marks in CSV files so they work in Excel?

I'm generating a CSV file (delimited by commas rather than tabs). My users will most likely open the CSV file in Excel by double clicking it. My data may contain commas and speech marks, so I'm escaping those as follows. Reference, Title,…
centralscru
  • 6,178
  • 3
  • 28
  • 37
1
2 3
99 100