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.

5011 questions
37
votes
3 answers

Separate string by tab characters

I have a text file that is tab-delimited. How can I separate this string into substrings for an array by detecting the tabs?
Jimmy
  • 559
  • 1
  • 8
  • 13
36
votes
6 answers

Should we HTML-encode special characters before storing them in the database?

I use MySQL to store data and my web pages are all encoded as UTF-8. I have a lot of Portuguese characters such as ç and õ and I'm wondering if I should HTML-escape them before storage. Should we store & as &, for example? And why (not)? What…
Mohamad
  • 34,731
  • 32
  • 140
  • 219
35
votes
4 answers

How to escape a square bracket for Pattern compilation?

I have comma separated list of regular expressions: .{8},[0-9],[^0-9A-Za-z ],[A-Z],[a-z] I have done a split on the comma. Now I'm trying to match this regex against a generated password. The problem is that Pattern.compile does not like square…
Afamee
  • 5,160
  • 9
  • 38
  • 43
34
votes
4 answers

for name in `ls` and filenames with spaces

next code doesnt work because of spaces in file names, How to fix? IFS = '\n' for name in `ls ` do number=`echo "$name" | grep -o "[0-9]\{1,2\}"` if [[ ! -z "$number" ]]; then mv "$name" "./$number" fi done
Yola
  • 18,496
  • 11
  • 65
  • 106
34
votes
5 answers

Check NSString for special characters

I want to check an NSString for special characters, i.e. anything except a-z, A-Z and 0-9. I don't need to check how many special characters are present, or their positions, I just need to know whether a particular string contains any or not. If it…
Michael
  • 1,477
  • 4
  • 18
  • 27
34
votes
4 answers

Why Subversion skips files which contain the @ symbol?

when I try to execute command like this (from a command-line or Perl script - it doesn't matter): svn revert "build\myfile@test.meta" SVN skips this file and outputs: Skipped 'build\myfile' I tried doing: svn revert "build\*.meta" But it gives…
Paulius Liekis
  • 1,676
  • 3
  • 18
  • 26
34
votes
4 answers

String.split() at a meta character +

I'm making a simple program that will deal with equations from a String input of the equation When I run it, however, I get an exception because of trying to replace the " +" with a " +" so i can split the string at the spaces. How should I go about…
apache
  • 567
  • 1
  • 5
  • 9
34
votes
8 answers

Is there a "glyph not found" character?

Let's assume we have a text that contains a Unicode character that cannot be displayed because our font has no corresponding glyph. Usually, a placeholder is displayed instead, e.g. a rectangular block thingy (see screenshot). Is there a "glyph not…
Sebastian Negraszus
  • 11,915
  • 7
  • 43
  • 70
33
votes
3 answers

Escaping special character when generating an XML in Java

I am trying to develop an XML export feature to give my application users to export their data in an XML format. I have got this feature ready and working until it started failing for some cases. Then I realized that it was because of some special…
Salman A. Kagzi
  • 3,833
  • 13
  • 45
  • 64
33
votes
4 answers

Pandas.read_csv() with special characters (accents) in column names �

I have a csv file that contains some data with columns names: "PERIODE" "IAS_brut" "IAS_lissé" "Incidence_Sentinelles" I have a problem with the third one "IAS_lissé" which is misinterpreted by pd.read_csv() method and returned as �. What is that…
farhawa
  • 10,120
  • 16
  • 49
  • 91
32
votes
2 answers

PHP: Dealing special characters with iconv

I still don't understand how iconv works. For instance, $string = "Löic & René"; $output = iconv("UTF-8", "ISO-8859-1//TRANSLIT", $string); I get, Notice: iconv() [function.iconv]: Detected an illegal character in input string in... $string…
Run
  • 54,938
  • 169
  • 450
  • 748
32
votes
2 answers

How do I grep for a greater than symbol?

I am trying to grep for a php function call grep -Ri '->someFunction' . But it's not working. What am I doing wrong?
Drew LeSueur
  • 19,185
  • 29
  • 89
  • 106
32
votes
5 answers

single quotes escape during string insertion into a database

Insertion fails when "'" is used. example string is: He's is a boy. I've attempted to skip the "'" using an escape symbol , but I believe this is not the right way. textBox3.Text.Replace("'", " \'"); string sql= "insert into gtable (1text,1memo)…
lunchbox
  • 435
  • 1
  • 6
  • 13
31
votes
9 answers

jQuery - Replace all parentheses in a string

I tried this: mystring= mystring.replace(/"/g, "").replace(/'/g, "").replace("(", "").replace(")", ""); It works for all double and single quotes but for parentheses, this only replaces the first parenthesis in the string. How can I make it work to…
HaBo
  • 13,999
  • 36
  • 114
  • 206
31
votes
10 answers

What should be the valid characters in usernames?

Many web based user authentication systems don't allow usernames that contain characters other than letters, numbers and underscores. Could there be a technical reason for that?
Emanuil Rusev
  • 34,563
  • 55
  • 137
  • 201