escaping

Escape ContainsTable Keywords

How can I escape ContainsTable control keywords (such as NEAR or ISABOUT) so that Full Text Search will actually look for those words, and not treat them as control keywords? ...

@ in p4 filename

I'd like to script p4 a little. Unfortunately, some of the filenames that we're tracking have "@" in the filename. The filenames are in the form [email protected]. If I try to do something like p4 sync a\@b.xml on a mac (or p4 sync [email protected] on windows) it gives the error: Invalid changelist/client/label/date '@b.xml' Is there another way to esca...

URL Encoding in JS for meaningful URLs and Rails Page Caching

Hi, I'm running a Rails Application which gets a lot of traffic at the moment so I started using Page Caching to increase the performance. So far everything works like a charm. But when I tried to also cache search results I run into a strange problem. My Approach: Use meaningful URLs for searching and pagination (/search?query=term&...

Javascript get image src: FF shows escaped chars, IE doesn't

If I set: <img src="test-àè" onclick="alert(this.src);"> on FF the alert shows an escaped message: test-%C3%A0 while on IE it shows the unescaped version: test-àè I'm using: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; in my page and windows-1252 encoding <meta http-equ...

Using YQL multi-query & XPath to parse HTML, how to escape nested quotes?

The title is more complicated than it has to be, here's the problem query. SELECT * FROM query.multi WHERE queries=" SELECT * FROM html WHERE url='http://www.stumbleupon.com/url/http://www.guildwars2.com' AND xpath='//li[@class=\"listLi\"]/div[@class=\"views\"]/a/span'; SELECT * FROM xml ...

Escape characters contained by bash variable in regex pattern

In my bash script, i am trying to execute following Linux command: sed -i "/$data_line/ d" $data_dir $data_line is entered by user and it may conatain special characters that could brake regex. How can i escape all of the possible special characters in $data_line before i execute sed command? ...

How to decode Unicode escape sequences like "\u00ed" to proper UTF-8 encoded characters?

Is there a function in PHP that can decode Unicode escape sequences like "\u00ed" to "í" and all other similar occurrences? I found similar question here but is doesn't seem to work. ...

How can I escape '"' when reading a csv-file with JDBC?

I am reading a csv-file with JDBC, using CsvJdbc. Some strings in the csv-file contains a "-char, how can I handle these situations? When I am reading the csv-file with: while (results.next()) { String name = results.getString("Name"); ... } I get this SQLException, on the line where I have while (results.next()) { java.sql....

Delphi / MySql : Problems escaping strings

N00b here, having problems escaping strings. I used the QuotedStr() function - shouldn't that be enough. Unfortunately, the string that I am trying to quote is rather messy, but I will post it here in case anyone wants to paste it into WinMerge or KDiff3, etc. I am trying to store an entire Delphi form into the database, rather than in...

Qt and unicode escape string.

I'm getting from server data using signal and slot. Here is slot part: QString text(this->reply->readAll()); Problem is, that in text variable will be unicode escape, for example: \u043d\u0435 \u043f\u0430\u0440\u044c\u0441\u044f ;-) Is there any way to convert this? ...

Is there a Delphi standard function for escaping HTML?

I've got a report that's supposed to take a grid control and produce HTML output. One of the columns in the grid can display any of a number of values, or <Any>. When this gets output to HTML, of course, it ends up blank. I could probably write up some routine to use StringReplace to turn that into &lt;Any&gt; so it would display this...

Python "string_escape" vs "unicode_escape"

According to the docs, the builtin string encoding string_escape: Produce[s] a string that is suitable as string literal in Python source code ...while the unicode_escape: Produce[s] a string that is suitable as Unicode literal in Python source code So, they should have roughly the same behaviour. BUT, they appear to treat si...

Validate Unicode String and Escape if Unicode is Invalid (C/C++)

I have a program that reads arbitrary data from a file system and outputs results in Unicode. The problem I am having is that sometimes filenames are valid Unicode and sometimes they aren't. So I want a function that can validate a string (in C or C++) and tell me if it is a valid UTF-8 encoding. If it is not, I want to have the invalid ...

BNF to handle escape sequence

I use this BNF to parser my script: ` {identset} = {ASCII} - {"\{\}}; //<--all ascii charset except '\"' '{' and '}' {strset} = {ASCII} - {"}; ident = {identset}*; str = {strset}*; node ::= ident "{" nodes "}" | //<--entry point "\"" str "\"" | ident; nodes ::= node nodes | ...

Escaping a String for Use in a preg_ Regular Expression

Is there a canonical function/method for escaping a string to be used in a preg_, such that any special PCRE characters will be interpreted as literal. Basically, a know way to ensure that something like I am a fancy string (well, that guy ... said I was fancy) is transformed into I am a fancy string \(well, that guy \.\.\. said I ...

How do I write unescaped XML outside of a CDATA

Hello I am trying to write XML data using Stax where the content itself is HTML If I try xtw.writeStartElement("contents"); xtw.writeCharacters("<b>here</b>"); xtw.writeEndElement(); I get this <contents>&lt;b&gt;here&lt;/b&gt;</contents> Then I notice the CDATA method and change my code to: xtw.writeStartElement("contents"); xt...

How can I stop XmlSerializer transforming &#234; to &amp;#234; in an attribute?

I have the following DOM <row> <link href="B&#252;ro.txt" target="_blank"> my link </link> </row> When I serialize it to a file using the Java XmlSerializer it comes out like this: <row> <link href="B&amp;#252;ro.txt" target="_blank"> my link </link> </row> Is ...

How to XML escaping with Apache Velocity?

I am generating XML using Apache Velocity. What is the best (most straight-forward) way to XML-escape the output? (I saw there is an escape tool, but could not figure out it's dev state. I also think that XML escaping is something that is very likely supported by Velocity directly.) ...

Replace all escape sequences with non-escaped equivalent strings in java

I have a string like this: &lt;![CDATA[&lt;ClinicalDocument&gt;rest of CCD here&lt;/ClinicalDocument&gt;]]&gt; I'd like to replace the escape sequences with their non-escaped characters, to end up with: <![CDATA[<ClinicalDocument>rest of CCD here</ClinicalDocument>]]> ...

Any way to get TStringList.CommaText to not escape commas with quotes?

I'm doing some work with code generation, and one of the things I need to do is create a function call where one of the parameters is a function call, like so: result := Func1(x, y, Func2(a, b, c)); TStringList.CommaText is very useful for generating the parameter lists, but when I traverse the tree to build the outer function call, w...