escaping

SQL escape with sqlite in C#

I have a text field and its breaking my sql statement. How do i escape all the chars in that field? I am using sqlite with http://sqlite.phxsoftware.com/ in C# ...

Escaped unicode to unicode character in Cocoa

I get from a NSURLConnection a NSData object which I convert with [[NSMutableString alloc] initWithData:[self urlData] encoding:NSUTF8StringEncoding] to a NSMutableString. After some "revision" I display it in a NSTextField. But when the response contains a more-than-utf8-string this is displayed: This "&#x27A1" should be one unico...

XSL character escape problem

Hi, I am writing this because I have really hit the wall and cannot go ahead. In my database I have escaped HTML like this: "<p>My name is Freddy and I was". I want to show it as HTML OR strip the HTML tags in my XSL template. Both solutions will work for me and I will choose the quicker solution. I have read several posts online...

How do you escape curly braces in javadoc inline tags, such as the {@code} tag.

/** * Gets the meatball icon for a nincompoop. * * <p> * Example: {@code <custom:meatball color="<%= Meatball.RED %> nincompoop="${person}" />} * * @author King Cong * */ The "${person}" part breaks the doc comment because it uses curly braces. Thanks in advance, LES ...

How do I escape double quotes in attributes in an XML String in T-SQL?

Pretty simple question - I have an attribute that I would like to have double quotes in. How do I escape them? I've tried \" "" \\" And I've made the @xml variable both xml type and varchar(max) for all of them. declare @xml xml --(or varchar(max) tried both) set @xml = '<transaction><item value="hi "mom" lol" ItemId="106"...

Escaping verbatim string literals

I have the following string which won't compile: String formLookupPull = @"SELECT value1, '"+tableName+"', '"+columnName+"' FROM lkpLookups WHERE ""table"" = '" + tableName + "' and ""field"" = '" + columnName + "';"; The offending sections are : ""table"" = and ""field"" = THe compiler is getting all mixed up on the escape seq...

Linq to SQL - double quote issue

I have a problem wherein if I have a text area in ASP.NET and enter 2 double quotes at the very end of the sentence, I get a error in my sql statement. I have traced thru the sql profiler but with no luck. eg. The lazy fox jump over the dog"". This fails.... ""The "lazy" fox jumps over the dog. This seems fine Any pointers most welcom...

Objective C HTML escape/unescape

Wondering if there is an easy way to do a simple HTML escape/unescape in Objective C. What I want is something like this psuedo code: NSString *string = @"&lt;span&gt;Foo&lt;/span&gt;"; [string stringByUnescapingHTML]; Which returns <span>Foo</span> Hopefully unescaping all other HTML entities as well and even ASCII codes like Ӓ a...

Using hibernate criteria, is there a way to escape special characters?

For this question, we want to avoid having to write a special query since the query would have to be different across multiple databases. Using only hibernate criteria, we want to be able to escape special characters. This situation is the reason for needing the ability to escape special characters: Assume that we have table 'foo' in ...

How can I add " character to a multi line string declaration in C#?

If I write something like this: string s = @"...."......"; it doesn't work. If I try this: string s = @"...\"....."; it doesn't work either. How can I add a " character to a multi line string declaration in C#? ...

Escape tags in html

What are escape tags in html? are they &#34; &#60; &#62; to represent ", <, > And how do these work? Is that hex, or what is it. How is it made, and why aren't they just the characters themselves? ...

rails: how to html encode/escape a string? is there a built-in?

Yay, silly question time. So I have an untrusted string that I simply want to show as text in an html page. All I need to do is escape the chars '<' and '&' as html entities. The less fuss the better. I'm using utf8 and don't need no other stinking entities for accented letters and so on. Is there anything built-in in ruby or rails, ...

How can I send terminal escape sequences in raw input mode?

I have a program that uses a terminal in raw mode and I want to move the cursor around. Where can I find the escape sequence for this and how can I send it to the terminal from inside my c program? Here's what I currently have: char code[4]; code[0] = 27; code[1] = 91; code[2] = '*'; code[3] = 'D'; write(1, code, 4); ...

Spaces in java execute path for OS X

On OS X, I am trying to .exec something, but when a path contains a space, it doesn't work. I've tried surrounding the path with quotes, escaping the space, and even using \u0020. For example, this works: Runtime.getRuntime().exec("open /foldername/toast.sh"); But if there's a space, none of these work: Runtime.getRuntime().exec("o...

Is there a good python module that does HTML encoding/escaping in C?

There is cgi.escape but that appears to be implemented in pure python. It seems like most frameworks like Django also just run some regular expressions. This is something we do a lot, so it would be good to have it be as fast as possible. Maybe C implementations wouldn't be much faster than a series of regexes for this? ...

Ruby: Write escaped string to YAML

The following... require 'yaml' test = "I'm a b&d string" File.open('test.yaml', 'w') do |out| out.write(test.to_yaml) end ...outputs ... --- this is a b&d string How can I get it to output --- 'this is a b&d string' ??? ...

What's the best way to add double quotes in sql server 2000

I have the following. SET QUOTED_IDENTIFIER ON GO SET ANSI_NULLS ON GO ALTER FUNCTION doublequotestring(@str nvarchar(1998)) RETURNS nvarchar(4000) AS BEGIN DECLARE @ret nvarchar(4000), @sq char(1) SELECT @sq = '"' SELECT @ret = replace(@str, @sq, @sq + @sq) RETURN(@sq + @ret + @sq) END...

Escape problem with hex

I need to print escaped characters to a binary file using Ruby. The main problem is that slashes need the whole byte to escape correctly, and I don't know/can't create the byte in such a way. I am creating the hex value with, basically: '\x' + char Where char is some 'hex' value, such as 65. In hex, \x65 is the ASCII character 'e'. ...

User provided input SQL-escaping

Can you please give me advise? I searched for questions but did not found something similiar to mine. How do i make my user inputs automatically escaped when they are intended to use in SQL queries? I don't like in my code filled with something like $var_x = $DB->Escape($_POST['var_x']); $another_var = $DB->Escape($_POST['another_var']...

JQuery selector value escaping

Hey all, I have a dropdown list that contains a series of options: <select id=SomeDropdown> <option value="a'b]&lt;p>">a'b]&lt;p></option> <option value="easy">easy</option> <select> Notice that the option value/text contains some nasty stuff: single quotes closing square bracket escaped html I need to remove the a'b]<p> opt...