escaping

how to have quotation marks in html input values

hi i have following problem - from the server side i get a string like 'hoschi"brother' i want to put this string into a <input value"MYSTRING" />. this results in something like <input value"hoschi" brother" /> which obviously does not work. any workarounds for this? does escaping the " character with &quot; work within the value ta...

PHP - Getting rid of curly apostrophes

I'm trying to get rid of curly apostrophes (ones pasted from some sort of rich text doc, I imagine) and I seem to be hitting a road block. The code below isn't working for me. $word = "Today’s"; $search = array('&#8222;', '&#8220;', '&#146;'); $replace = array('"', '"', "'"); $word = str_replace($search, $replace, htmlentities($word, E...

Django syntax highlighting causing character escaping issues

I've been working on my own django based blog (like everyone, I know) to sharpen up my python, and I thought added some syntax highlight would be pretty great. I looked at some of the snippets out there and decided to combine a few and write my own syntax highlighting template filter using Beautiful Soup and Pygments. It looks like this:...

Get hex or octal value from escaped string

I'm working on an application that needs to accept posted data from a form and process it. One step of this process is to unescape the data that comes in. One issue that I'm facing is that the data I'm grabbing from the form is binary in nature so it includes escape sequences that I need to turn back into characters. This is fairly trivi...

Powershell Script not accepting $ (Dollar) sign

I am trying to open a SQL data connection using powershell script and my password contains a $ sign: $cn = new-object system.data.SqlClient.SqlConnection("Data Source=DBNAME;Initial Catalog=Catagory;User ID=User;Password=pass$word;") When I try to open a connection it says Login failed. ...

Javascript & jQuery escaping quotes

I'm trying to do inline editing for my website using jQuery so I can edit the HTML and text of a page without having to change the source. When I submit the form data though jQuery's $.ajax function, it escapes all the quotes. How can I either prevent jQuery from escaping this(probably a bad idea) or remove them on the PHP side of things...

how to implement conditional htmlspecialchars?

If it's <script src="/script/jquery.autocomplete.js" type="text/javascript"> ,should call htmlspecialchars. If it's <pre><code><script src="/script/jquery.autocomplete.js" type="text/javascript"></code></pre>,should leave it as is. How to do this kind of task? EDIT Think you are using wmd editor like SO,and you included some code but...

can't escape fullscreen mode by escape key in vista i.e 8

when i try to escape full screen mode in flash by escape key it doesn't close the fullscreen unless i press somewhere on the flash area. this happens only in vista i.e 8 (this combination only!!!). i would like yo know if you ever run into it . I have no idea what can cause it. any suggestions? thanks ...

latex escape chars

Hi, I want to prepare a text for the use in a LaTeX document. I wrote a SQL Function which does a lot of REPLACE. For example "_" -> "_" and so on. But there are so many special chars and sometimes I get errors... Does anyone know a sql-function or a java package for escaping text to LaTeX? greatings Uwe ...

What's going on with tr(anslate) here?

in applescript if i do: do shell script "echo \"G:\\CRE\\MV Studios\\Exhibition Projects\"|tr \"\\\\\" \"/\"" I'd expect all my backslashes to come back forward slashes. To make it slightly easier to understand he tr command would look like this without all the escapes tr "\\" "/" #there's still an escaped \ for the shell But what ...

How to replace escape characters in Regular expression?

Hello everyone, Once again I have hit the wall. How to replace escape characters using regular expressions? If tab character (\t) occures more than twice, I want to replace those two or more occurances by single \t. For example if \t\t\t comes, then I want to replace it with \t only. How to do this? I am facing one more problem regard...

RegEx for String.Format

Hiho everyone! :) I have an application, in which the user can insert a string into a textbox, which will be used for a String.Format output later. So the user's input must have a certain format: I would like to replace exactly one placeholder, so the string should be of a form like this: "Text{0}Text". So it has to contain at least on...

Escaping data for use within a CodeIgniter View

I have a controller and a view; the data that I'm working with inside the controller can't be trusted (it's drawn from somewhere external, and isn't $_GET or $_POST). How do I escape the data when printing it in the view to ensure that tags and other things are escaped properly? I'm used to Zend_View's $this->escape($foo), which is used...

URL and the ampersand

Using XSLT and XPath 1.0, I have a string I want to escape for use on a URL, for example: <description>one word &amp; another</description> So, the text() of the description element should get URL escaped. How would I do this? Using C# (XslCompiledTransform) the code would be: string a = Server.UrlEncode("one word & another"); An...

Escaping an apostrophe in Java

I'm still somewhat new to Java and trying to insert data into a database. I'm getting an error when inserting a string containing 's so my end result would be to escape the apostrophe. How can I accomplish? ...

Do I need to escape these in javascript?

My strings will hold the values: "[" "[/blah]" do I need to escape anything? Is it just doubling the /? ...

vim regexps from the perl's point of view: which special characters to escape with backslash

Imagine, we have to construct a regexp in vi/vim. Which special characters we have to escape with backslash? By special characters I mean the following chars: {}|()-[]+*.^$? Seems like we have to escape: {|()+? And leave as is: }^$*.[]- Thanks. p.s. AFAIK, we have no '?' character in vi/vim but '=' instead which should be also esc...

Add apostrophe to last name search

I created a proc that will return a list of applicants by lastname. I have a problem searching Applicants with last name that has apostrophe (Example O'Connor). Could you please help finding those applicants: Below is my Search Code: if Rtrim(@FirstName) <> '' begin If(Len(@FirstName) < 30) and (CharIndex('%', @FirstName) = 0) and @...

How to store "<" in an XML attribute for configuration section?>

Hello, I'm using a custom configuration section in my web.config file for ASP.NET One of my fields is: <add percent="5" label="<5%" /> As you can see in label I have a "<" sign - this is causing errors. How can I store this value there without having compile issue? Thanks! ...

Backslash problem with String.replaceAll

I'm trying to convert "\something\" into "\\something\\" using replaceAll, but I keep getting all kinds of errors. I thought this was the solution: theString.replaceAll("\\", "\\\\"); But this gives: Exception in thread "main" java.util.regex.PatternSyntaxException: Unexpected internal error near index 1 ...