Search Results

Search found 390 results on 16 pages for 'escaping'.

Page 4/16 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How Do I Convert Pipe Delimited to Comma Delimited with Escaping

    - by Russ Bradberry
    Hi, I am fairly new to scala and I have the need to convert a string that is pipe delimited to one that is comma delimited, with the values wrapped in quotes and any quotes escaped by "\" in c# i would probably do this like this string st = "\"" + oldStr.Replace("\"", "\\\\\"").Replace("|", "\",\"") + "\"" I haven't validated that actually works but that is the basic idea behind what I am trying to do. Is there a way to do this easily in scala?

    Read the article

  • Escaping Problem

    - by James Jeffery
    How can escape quotes for use in HTML? My line of code is: <body onload="setTimeout('window.location='http://somepage.com'', 1000)"> As you can see in the current example, there are two ', and a " being used. How can I escape them for the above to work? The onload contents are set dynamically for a system I am working on @ work.

    Read the article

  • Backslashes in gsub (escaping and backreferencing)

    - by polygenelubricants
    Consider the following snippet: puts 'hello'.gsub(/.+/, '\0 \\0 \\\0 \\\\0') This prints (as seen on ideone.com): hello hello \0 \0 This was very surprising, because I'd expect to see something like this instead: hello \0 \hello \\0 My argument is that \ is an escape character, so you write \\ to get a literal backslash, thus \\0 is a literal backslash \ followed by 0, etc. Obviously this is not how gsub is interpreting it, so can someone explain what's going on? And what do I have to do to get the replacement I want above?

    Read the article

  • Ideal Java library for cleaning html, and escaping malformed fragments

    - by Tyler
    I've got some HTML files that need to be parsed and cleaned, and they occasionally have content with special characters like <, , ", etc. which have not been properly escaped. I have tried running the files through jTidy, but the best I can get it to do is just omit the content it sees as malformed html. Is there a different library that will just escape the malformed fragments instead of omitting them? If not, any recommendations on what library would be easiest to modify? Clarification: Sample input: <p> blah blah <M+1> blah </p> Desired output: <p> blah blah &lt;M+1&gt; blah </p>

    Read the article

  • UTF8 charset, diacritical elements, conversion problems - and Zend Framework form escaping

    - by imanc
    Hey, I am writing a webapp in ZF and am having serious issues with UTF8. It's using multi lingual content through Zend Form and it seems that ZF heavily escapes all of these characters and basically just won't show a field if there's diacritical elements 'é' and if I use the HTML entity equivalent e.g. é it gets escaped so that the user will see 'é'. Zend Form allows for having non escaped data, but trying to use this is confusing, and it seems it'd need to be used all over the place. So, I have been told that if the page and the text is in UTF8, no conversion to htmlentities is required. Is this true? And if the last question is true, then how do I convert the source text to UTF8? I am comfortable setting up apache so that it sends a default UTF8 charset heading, and also adding the charset meta tag to the html, but doing this I am still getting messed up encoding. I have also tried opening the translation csv file in TextWrangler on OSX as UTF8, but it has done nothing. Thanks! L

    Read the article

  • escaping a dollar in the middle of an ant property

    - by jk
    I have a property whose value contains a $. I'd like to use this property as a regexp in a propertyregexp. Ant appears to resolve the property as a paramater to the propertyregexp, but then the dollar gets interpreted as a regexp symbol. Example: <property name="a" value="abc$" /> <property name="b" value="xyz" /> <path id="paths"> <pathelement location="abc$/def" /> <pathelement location="abc$/ghi" /> </path> <pathconvert property="list" refid="paths" pathsep="${line.separator}" dirsep="/" /> <propertyregex property="list" input="${list}" override="true" regexp="${a}(.*)" replace="${b}\1" /> <echo message="${list}" /> I'd like to the pair xyz/def and xyz/ghi. Is this possible? I'm using Ant 1.8.

    Read the article

  • prevent escaping special characters on textnode(JS-HTML)

    - by UnLoCo
    Hello i followed this snippet http://bytes.com/topic/javascript/answers/504399-get-all-text-nodes var xPathResult = document.evaluate( './/text()[normalize-space(.) != ""]', document.body, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null ); for (var i = 0, l = xPathResult.snapshotLength; i < l; i++) { var textNode = xPathResult.snapshotItem(i); textNode.data = textNode.data.replace(/somePattern/g, 'replacement'); } i want to replace certain patterns like for example |12| with a corresponding emoticon ! but when i do textNode.data.replace("|12|",'<.img src="favicon.ico"/>'); for example the text show is ..<.img src="favicon.ico"/>.. as i inspect the html i find that <.img src="favicon.ico"/> became escaped to &lt;img src="favicon.ico"/&gt; is it possible to prevent this and to let the image show ?? Thank You Note: added extra point here &lt;.img src="favicon.ico"/&gt; in purpose

    Read the article

  • Scribus - disable escaping of text field

    - by ityndall
    Scribus 1.3.3.13 - Ubuntu 64bit I have a scribus document that I'm creating with text fields. I'm using the text fields for code samples, as that appeared to be the only way to have a scrolling text frame. Upon conversion of the document, these text fields get populated with escape characters. Is there any way to disable the escape sequences that are getting populating into these text fields?

    Read the article

  • Will the compiler optimize escaping an inner loop?

    - by BCS
    The code I have looks like this (all uses of done shown): bool done = false; for(int i = 0; i < big; i++) { ... for(int j = 0; j < wow; j++) { ... if(foo(i,j)) { done = true; break; } ... } if(done) break; ... } will any compilers convert it to this: for(int i = 0; i < big; i++) { ... for(int j = 0; j < wow; j++) { ... if(foo(i,j)) goto __done; // same as a labeled break if we had it ... } ... } __done:;

    Read the article

  • Unicode and URI encoding, decoding and escaping in JavaScript

    - by apphacker
    If you look at this table here, it has a list of escape sequences for Unicode characters that don't actually work for me. For example for "%96", which should be a –, I get an error when trying decode: decodeURIComponent("%96"); URIError: URI malformed If I attempt to encode "–" I actually get: encodeURIComponent("–"); "%E2%80%93" I searched through the internet and I saw this page, which mentions using escape and unescape with decodeURIComponent and encodeURIComponent respectively. This doesn't seem to help because %96 doesn't show up as "–" no matter what I try and this of course wouldn't work: decodeURIComponent(escape("%96)); "%96" Not very helpful. How can I get "%96" to be a "–" with JavaScript (without hardcoding a map for every single possible unicode character I may run into)?

    Read the article

  • Baffled by PHP escaping of double-quotes in HTML forms

    - by rjray
    I have a simple PHP script I use to front-end an SQLite database. It's nothing fancy or complex. But I have noticed from looking at the records in the database that anything I enter in a form-field with double-quotes comes across in the form-processing as though I'd escaped the quotes with a backslash. So when I entered a record with the title: British Light Utility Car 10HP "Tilly" what shows up in the database is: British Light Utility Car 10HP \"Tilly\" I don't know where these are coming from, and what's worse, even using the following preg_replace doesn't seem to remove them: $name = preg_replace('/\\"/', '"', $_REQUEST['kits_name']); If I dump out $name, it still bears the unwanted \ characters.

    Read the article

  • Escaping comma in java

    - by prasanna
    I have a string which is fed into the query as IN clause,which looks like this ('ACT','INACT') which is one of the parameters to a function inside a package.when a call is made to the function from java, it looks like this call package.function(1,2,3,('ACT','INACT'),4,5). When the package is called,i get error as wrong type of arguments. It is taking the values inside brackets as different values delimited by strings

    Read the article

  • Escaping if/else in Jade template

    - by Collin Estes
    So I have a simply block of html in my jade template with a loop: each dude, i in dudes div(class='someClass') div.otherStuff span.someContent #{name} I want to apply a data attribute to my top most div when a certain looping condition is met, in this case the first dude, I set it up like this each dude, i in dudes if i == 0 div(class='someClass, data-someAttr='first dude') else div(class='someClass') div.otherstuff span.someContent Setup like this it causes the div.otherStuff div and the span.someContent to only display on the else condition. I've moved the tab spaces around on those items but I can't get it escape that else and give the div.otherStuff and span.someContent to both the first dude and the subsequent dudes after that. I've also tried setting that data attr to a variable and trying to apply it that way but without any success. What I end up doing to get around it is this: each dude, i in dudes if i == 0 div(class='someClass, data-someAttr='first dude') div.otherstuff span.someContent else div(class='someClass') div.otherstuff span.someContent How do I escape that if/else so I dont have to duplicate the div.otherStuff and span.someContent?

    Read the article

  • Escaping quotes twice in PHP

    - by Genadinik
    Hello, I have a complicated form where I first have to take some _GET parameters and obviously I have to do a mysql_real_escape_string() on them since I look stuff up in the database with them. Them problem for me is after the initial db lookup. When the user submits a form, I send them along as a _POST request and obviously have to do this mysql_real_escape_string call again just in case someone tries to hack my site with a faked form submission. Then the problem I have is the arguments are escaped twice and my queries begin to look strange like this: select field1 , field2 , from my_table where some_id = \'.$lookup_id.\' ... So the system seems to be adding \' and it is messing me up :) Also, in my other forms I have not seen such behavior. Any ideas on what may be causing this? One weird thing is that I tried to send unescaped parameters to the post, and the same problem happens. That is a clue, but not a sufficient one for me. :( Thanks, Alex

    Read the article

  • Escaping HTML strings with jQuery

    - by Page Brooks
    Does anyone know of an easy way to escape HTML from strings in jQuery? I need to be able to pass an arbitrary string and have it properly escaped for display in an HTML page (preventing JavaScript/HTML injection attacks). I'm sure it's possible to extend jQuery to do this, but I don't know enough about the framework at the moment to accomplish this.

    Read the article

  • Unicode escaping in C/C++

    - by Geo
    Hi guys! I'm having a dispute with a colleague of mine. She says that the following: char* a = "\x000aaxz"; will/can be seen by the compiler as "\x000aa". I do not agree with her, as I think you can have a maximum number of 4 hex characters after the \x. Can you have more than 4 hex chars? Who is right here?

    Read the article

  • Seeking assistance with Escaping Data for MySQL queries

    - by JM4
    Please don't send me a link to php.net referencing mysql_real_escape_string as the only response. I have read through the page and while I understand the general concepts, I am having some trouble based on how my INSERT statement is currently built. Today, I am using the following: $sql = "INSERT INTO tablename VALUES ('', '$_SESSION['Member1FirstName'], '$_SESSION['Member1LastName'], '$_SESSION['Member1ID'], '$_SESSION['Member2FirstName'], '$_SESSION['Member2LastName'], '$_SESSION['Member2ID'] .... and the list goes on for 20+ members with some other values entered. It seems most people in the examples already have all their data stored in an array. On my site, I accept form inputs, action="" is set to self, php validation takes place and if validation passes, data is stored into SESSION variables on page 2 then redirected to the next page in the process (page 3) (approximately 8-10 pages in the whole process). thanks!

    Read the article

  • standard c library for escaping a string.

    - by rampion
    Is there a standard C library function to escape C-strings? For example, if I had the C string: char example[] = "first line\nsecond line: \"inner quotes\""; And I wanted to print "first line\nsecond line: \"inner quotes\"" Is there a library function that will do that transformation for me? Rolling my own just seems a little silly. Bonus points if I can give it a length to escape (so it stops before or beyond the \0).

    Read the article

  • Escaping ’ character in PHP

    - by richard
    Hello, I'm having a hard time trying to replace this weird right single quote character. I'm using str_replace like this: str_replace("’", '\u1234', $string); It looks like I cannot figure out what character the quote really is. Even when I copy paste it directly from PHPMyAdmin it still doesn't work. Do I have to escape it somehow?

    Read the article

  • SQLite issues, escaping certain characters...

    - by CODe
    I'm working on my first database application. It is a WinForms application written in C# using a SQLite database. I've come across some problems, when a apostrophe is used, my SQLite query fails. Here is the structure of my queries. string SQL = "UPDATE SUBCONTRACTOR SET JobSite = NULL WHERE JobSite = '" + jobSite + "'"; For instance, if an apostrophe is used in the jobSite var, it offsets the other apostrophes in the command, and fails. So my questions are: 1. How do I escape characters like the apostrophe and semicolon in the above query example? 2. What characters do I need to escape? I know I should escape the apostrophe, what else is dangerous? Thanks for your help!

    Read the article

  • How do I modify the HttpResponse object in django ?

    - by Rohit
    I need the html returned using render_to_response to be escaped. I am unable to find any suitable documentation. Can someone point in some direction ? the code is : return render_to_response(template_name, {return render_to_response(template_name, { 'form': form, redirect_field_name: redirect_to, 'site': current_site, 'site_name': current_site.name, }, context_instance=RequestContext(request)) Here I need the response html text to be escaped. I way I know is reading template file in string and escaping it with re.escape() and then rendering it. whats a cleaner and simpler way to do that ??

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >