escape-character

Escape quote character in xml

Is there an escape character for a quote in xml? I want to write a tag like: <parameter name="Quote = " "> but if I put ", then that means string has ended. I need something like this (c++): printf("Quote = \" "); Is there a character to write before the quote to escape it? ...

How can I escape a single quote in a XAML markup extension property literal?

I have a value converter that formats numbers (I can't use SP1 yet unfortunately). It works fine until it gets a percentage. Here's an example: <TextBlock Text="{Binding Path=PercentageComplete, Converter={StaticResource NumberFormatter}, ConverterParameter='0.00 %'}" /> Unfortunat...

Zend Lucene fails all searches with special characters. Halp?

Hey, if anyone knows a simple answer to this, I don't have to wade through creating an extra index with escaped strings and crying my eyes out while littering my pretty code. Basically, the Lucene search we have running cannot handle any non-letter characters. Space, percent signs, dots, dashes, slashes, you name it. This is higly infur...

Escape character in VB.NET

For displaying the character & in a button as text, i am using && I would like to display the string % in another one button but the &% does not work. So how can i display the char % By using this btn5.Text = "%" the percentage symbol is not displayed at all! ...

bash: Using sed in backticks

I want to escape some special chars inside a string automatically. I thought of echoing that string and pipe it through some seds. This doesn't seem to work inside of backticks. So why does echo "foo[bar]" | sed 's/\[/\\[/g' return foo\[bar] but FOO=`echo "foo[bar]" | sed 's/\[/\\[/g'` && echo $FOO just returns foo[bar] ? ...

Why does bash ignore newlines when doing for loop over the contents of a C-style string?

Why does the following... c=0; for i in $'1\n2\n3\n4'; do echo iteration $c :$i:; c=$[c+1]; done print out... iteration 0 :1 2 3 4: and not iteration 0 :1: iteration 1 :2: iteration 2 :3: iteration 3 :4: From what I understand, the $'STRING' syntax should allow me to specify a string with escape characters. Shouldn't "\n" be in...

Java: Literal percent sign in printf statement

I'm trying to add an actual percent sign into a printf statement in Java and I'm getting the error: lab1.java:166: illegal escape character System.out.printf("%s\t%s\t%1.2f\%\t%1.2f\%\n",ID,pattern,support,confidence); ^ lab1.java:166: illegal escape character ...

Function escaping quote is not working correctly [Solved]

Hi, (Php & MySQL) I'm trying to figure out how come this function does not work correctly. It's add extra \ everytime I edit my entries. Online server have these settings: magic_quotes_gpc On magic_quotes_runtime Off magic_quotes_sybase Off function esc($s) { if (get_magic_quotes_gpc()) { if (ini_get('magic_quotes_sy...

Openoffice - CSV-export: is there a default escape-charcter?

Hello! As far as I can see OpenOffice, when it comes to save a file as a csv-file, encloses all strings in quote-characters. So is there any need for an escape character? and related to this question: Does OpenOffice have a default escape character? ...

How may i escape / and other characters in asp.net?

When i visit http://localhost:17357/u/a%2fa/m/ssd-10 and look at HttpContext.Current.Request.Url in Application_BeginRequest i see http://localhost:17357/u/a/a/m/ssd-10 huh? shouldnt i get http://localhost:17357/u/a%2fa/m/ssd-10? i thought the point of escaping urls is so ?, &, / and other special symbols not be confused with their speci...

Grepping for string containing dash

I want to grep for the string "-X" in a file but it's confusing this as a command line argument. I've tried grep "-X" grep \-X grep '-X' ...

How does one escape an apostrophe in db2 sql

I'm looking for the db2 equivalent of T-SQL's: INSERT INTO People (Surname) VALUES ('O''Hara'); ...

How to escape the character entities in XML?

I want to pass XML as a string in an XML attribute. <activity evt="&lt;FHS&gt; &lt;act&gt; &lt;polyline penWidth=&quot;2&quot; points=&quot;256,435 257,432 &quot;/&gt; &lt;/act&gt; &lt;/FHS&gt;" /> Here the "evt" attribute is the XML string, so escaping all the less-than, greater-than, etc characters by the appr...

Escaping single quote in PHP when inserting into MySQL

I have a perplexing issue that I can't seem to comprehend... I'm hoping someone here might be able to point me in the right direction... I have two SQL statements: - the first enters information from a form into the database. - the second takes data from the database entered above, sends an email and then logs the details of the transac...

Problem when reading backslash in Prolog

I'm writing a lexer in Prolog which will be used as a part of functional language interpreter. Language spec allows expressions like for example let \x = x + 2; to occur. What I want lexer to do for such input is to "return": [tokLet, tokLambda, tokVar(x), tokEq, tokVar(x), tokPlus, tokNumber(2), tokSColon] and the problem is, that P...

Removing backslashes from a string in Python

How do I remove all the backslashes from a string in Python? This is not working for me: result = result.replace("\\", result) Do I need to treat result as a raw string? ...

Javascript: Escape " from json string

Hi, I've got a bit of a problem. I'm currently working on converting an old system to a newer version. In the old version, data requests were managed by Java applets, which had no problems with the "-char in the data. Now, though, I'm fetching the data from a database and converting it to a JSON-string using XSLT, and then - with the pro...

What is the best escape character strategy for Python/MySQL combo?

This is my query. cursor2.execute("update myTable set `"+ str(row[1]) +"` = \"'" + str(row[3]) +"'\" where ID = '"+str(row[0])+"'") It is failing when row values have double quotes "some value". How do I escape all special characters? Any feedback is highly appreciated. Thank you... ...

What should an escape character do if the following character doesn't need escaping?

An application I'm working on has a field where a string can be entered. Special characters in the string cause different things to be inserted when the string is evaluated, but these special characters can be preceded by an escape character (a backslash) which cause the special character to be output literally rather than its special m...

Is there an escape character in MASM?

I know that strings surrounded by single quotes can contain double quotes and vice versa, but can a string contain both? For example, the string: How do you say, "Where's the bathroom?" in Spanish? ...