Search Results

Search found 1625 results on 65 pages for 'ansi escape'.

Page 10/65 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • 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

  • Git Shell in Windows: patch's default character encoding is UCS-2 Little Endian - how to change this to ANSI or UTF-8 without BOM?

    - by Sk8erPeter
    When creating a diff patch with Git Shell in Windows (when using GitHub for Windows), the character encoding of the patch will be UCS-2 Little Endian according to Notepad++ (see the screenshots below). How can I change this behavior, and force git to create patches with ANSI or UTF-8 without BOM character encoding? It causes a problem because UCS-2 Little Endian encoded patches can not be applied, I have to manually convert it to ANSI.

    Read the article

  • ash scripting: space-containing variable refuses to be grepped

    - by Luci Sandor
    I am trying to run the script listed at http://talk.maemo.org/showthread.php?t=70866&page=2 on its intended hardware, a Nokia Linux phone running BusyBox ash. The script receives the name of WiFi network as a parameter, and tries to connect the phone to it. I suspect the script works, but my SSID, BU (802.1x), has space and parentheses in it. So when I type at the command prompt autoconnect.sh BU\ \(802.1x\) I get various errors. First, LIST=`iwconfig wlan0 | awk -F":" '/ESSID/{print $2}'` if [ $LIST = "\"$1\"" ]; then ...fails, even I am connected to the network. The error is not avoided by using single or double quotes instead of escaping characters at the command prompt. Second, if [ -z `iwlist wlan0 scan | grep -m 1 -o \"$1\"` ]; then echo SSID \"$1\" not found; shows that grep does not find the string, although the same grep, typed directly into the command prompt, does find 'BU (802.1x)'. How do I quote $1 in the two circumstances above so that it will work with my network SSID, containing spaces and parentheses? Thank you.

    Read the article

  • How to convert Windows filenames (from a checksums.md5) to *nix notation so I can use it on my shell with md5sum?

    - by Somebody still uses you MS-DOS
    I have some checksums.md5 verification files from an ntfs external drive, but using windows notation: \ instead of /, spaces between file names (not escaped), reserved shell characters (like (, &, ', to name a few). The checksums.md5 has a bunch of checksums and filenames: ;Created by program ;2010 f12f75c1f2d1a658dc32ca6ef9ef3ffc *My Windows & Files (2010)\[bak]\testing.wmv 53445e1a0821b790872e60bd7a166887 *My Windows Files' 2 (2012)\[bak]\testing.wmv 53445e1a0821b790872e60bd7a166887 *My Windows Files ˜nicóde (2012)\[bak]\testing.wmv ;Finished I want to use this checksums.md5 to verify the files that I've copied to my machine: but I'm on a Linux, so I need to convert the names inside checksums.md5 from Windows to Linux to use the md5sum utility from the shell. The first line in my example would become: f12f75c1f2d1a658dc32ca6ef9ef3ffc My\ Windows\ \&\ Files\ \(2010\)/\[bak\]/testing.wmv Is there some application for this (converting a file listing, from windows cmd notation, to linux shell notation) or will I need to create a bash script using sed that just "replaces" what is "wrong" with the filenames?

    Read the article

  • Escaping %’s in file-/folder-names at the command-line

    - by Synetech
    Does anybody of a way to access files and directories that have a % in their name (which is valid) from the command-line? Specifically, if there are two %’s and the text between them happens to correspond to an environment variable. For example, if there is a file called C:\blah\%temp%.txt or a folder called C:\Program Files\%temp%\, none of the following will work because the variable gets expanded: > dir "c:\blah\%temp%.txt" > dir "c:\blah\^%temp^%.txt" > dir "c:\blah\%%temp%%.txt" > dir "c:\blah\\%temp\%.txt" > dir "c:\program files\%temp%" > dir "c:\program files\^%temp^%" > dir "c:\program files\%%temp%%" > dir "c:\program files\\%temp\%" Using wildcards will work, but does not uniquely select the file/folder and may include others: > dir "c:\blah\?temp?.txt"        (also shows ztempz.temp, 1tempa.txt, etc.) > dir "c:\program files\?temp?"   (likewise) (This is frustrating because every now and then—usually when Explorer is restarted for whatever reason—the environment variables stop expanding and some places where they are used end up creating files or directories with the environment variable in it. For example, because I configured Chromium to store its cache in a subdirectory of %temp%, if the variable expands, it is fine, but when it doesn’t, Chromium creates a directory called %temp% under its own directory and stores the cache—which can get large—there. I want to add a line to my temp-/junk-file cleaning script to automatically delete that folder if it exists, but I cannot figure out how to access it from the command-line without resorting to wildcards.)

    Read the article

  • Escape apostrophe when passing parameter in onclick event

    - by RememberME
    I'm passing the company name to an onclick event. Some company names have apostrophes in them. I added '.Replace("'", "'")' to the company_name field. This allows the onclick event to fire, but the confirm message displays as "Jane's Welding Company". <a href="#" onclick="return Actionclick('<%= Url.Action("Activate", new {id = item.company_id}) %>', '<%= Html.Encode(item.company1.company_name.Replace("'", "&#39;")) %>');" class="fg-button fg-button-icon-solo ui-state-default ui-corner-all"><span class="ui-icon ui-icon-refresh"></span></a> <script type="text/javascript"> function Actionclick(url, companyName) { if (confirm('This action will activate this company\'s primary company ('+companyName+') and all of its other subsidiaries. Continue?')) { location.href = url; }; };

    Read the article

  • How to escape forward slash?

    - by AndrewB
    I have the following sql command through code and because the parameter contains a forward slash when I evaluate the sql row after the update the column is just empty. sqlCommand.CommandText = String.Format("update {0} set {1}='{2}'where id = @Id", tableName, ColumnName, forwardSlashText); sqlCommand.Parameters.Add("@Id", SqlDbType.UniqueIdentifier).Value = rowId; numRowsAffected = sqlCommand.ExecuteNonQuery(); adding a log.debug to this command i get the following output... update my_table_name set mime_type='application/pdf' where id = @Id So i would assume that the command is correct, but then looking at the row the mime_type column is empty.

    Read the article

  • Escape key event problem in wxPython?

    - by MA1
    Hi All The following key event is not working. Any idea? class Frame(wx.Frame): def __init__(self): wx.Frame.__init__(self, None, -1, title='testing', size=(300,380), style= wx.MINIMIZE_BOX|wx.SYSTEM_MENU |wx.CAPTION|wx.CLOSE_BOX|wx.CLIP_CHILDREN) self.tree = HyperTreeList(self, style = wx.TR_DEFAULT_STYLE | wx.TR_FULL_ROW_HIGHLIGHT | wx.TR_HAS_VARIABLE_ROW_HEIGHT | wx.TR_HIDE_ROOT) # create column self.tree.AddColumn("coll") self.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown) def OnKeyDown(self, event): keycode = event.GetKeyCode() print "keycode ", keycode if keycode == wx.WXK_ESCAPE: print "closing" self.Close() Regards,

    Read the article

  • how to escape white space in bash loop list

    - by MCS
    I have a bash shell script that loops through all child directories (but not files) of a certain directory. The problem is that some of the directory names contain spaces. Here are the contents of my test directory: $ls -F test Baltimore/ Cherry Hill/ Edison/ New York City/ Philadelphia/ cities.txt And the code that loops through the directories: for f in `find test/* -type d`; do echo $f done Here's the output: test/Baltimore test/Cherry Hill test/Edison test/New York City test/Philadelphia Cherry Hill and New York City are treated as 2 or 3 separate entries. I tried quoting the filenames, like so: for f in `find test/* -type d | sed -e 's/^/\"/' | sed -e 's/$/\"/'`; do echo $f done but to no avail. There's got to be a simple way to do this. Any ideas? The answers below are great. But to make this more complicated - I don't always want to use the directories listed in my test directory. Sometimes I want to pass in the directory names as command-line parameters instead. I took Charles' suggestion of setting the IFS and came up with the following: dirlist="${@}" ( [[ -z "$dirlist" ]] && dirlist=`find test -mindepth 1 -type d` && IFS=$'\n' for d in $dirlist; do echo $d done ) and this works just fine unless there are spaces in the command line arguments (even if those arguments are quoted). For example, calling the script like this: test.sh "Cherry Hill" "New York City" produces the following output: Cherry Hill New York City Again, I know there must be a way to do this - I just don't know what it is...

    Read the article

  • SharpZip escape filename

    - by mr.moses
    I'm using SharpZipLib to create a zip file with an html page and images. If the html file has a / in the name, it creates a folder (which messes up the image paths). Example: If the html file should be named Web/Design.html the zip file will contain a Web folder with a Design.html file in it. I've tried escaping / by replacing / with // or \/ but nothing has worked so far.

    Read the article

  • perl regex escape characters

    - by freshWoWer
    I have heard perl is a good language at doing regex but i am a bit confused at the characters that requires escaping I tested the code on http://regexlib.com/RETester.aspx and got the result I want //home/dev/abc/code/hello/world.cpp#1 //home/dev/((.*?)/[^/]+).*# Match $1 $2 //home/dev/abc/code/hello/world.cpp# abc/code abc However, I am not quite sure how do i translate this to perl code I tried, \/\/home\/dev\/\(\(\.\*\?\)\/\[\^\/\]\+\)\.\*\# and \/\/home\/dev\/((.*?)\/[^\/]+).*\# and both failed Don't you think the escaping makes the regex very unreadable? Am i using something wrong?

    Read the article

  • How to "escape" a whole String - an SQL query

    - by Ankur
    When I add a relative path to an SQL query as a String all the \ get removed. I am trying to add the String ("pics\\"+onlyFile) and as you can see I have escaped the \ character so I don't understand why it is being removed. onlyFile is a variable containing a file name. The value of the "src" variable (the one I am discussing) just before the SQL statement is correct, hence it is something happening when it is added to the SQL query.

    Read the article

  • Mysql Real Escape String PHP Function Adding "\" to My Field Entry

    - by Jascha
    Hello, I am submitting a form to my mySql database using PHP. I am sending the form data through the mysql_real_escape_string($content); function. When the entry shows up in my database (checking in myPhpAdmin) all of my double quotes and single quotes are escaped. I'm fairly certain this is a PHP configuration issue? so: $content = 'Hi, my name is Jascha and my "favorite" thing to do is sleep'; mysql_real_escape_string($content); $query = 'INSERT INTO DB...' comes up in my database as: Hi, my name is Jascha and my \"favorite" thing to do is sleep Who do I tell what to do? (I cannot access the php.ini). -J

    Read the article

  • mod rewrite escape chars

    - by Eugene
    hi, simple question www.site.com/page/3 to be www.site.com/page--3 so that i can read the pagenumber and page This is what i got but i dont know how to use the '--' and slash together instead. RewriteRule ^/?([a-zA-Z0-9-]+)/([a-zA-Z0-9-]+)$ index.php?page=$1&subpage=$2 Any help appreciated

    Read the article

  • mysql real escape string error

    - by user547995
    Code mysql_query("INSERT INTO Account(User, Pw, email) VALUES('mysql_real_escape_string($_POST[user])', '$pw','mysql_real_escape_string($_POST[email]) ) ") or die(mysql_error()); Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''mysql_real_escape_string(123) )' at line 1 Please help

    Read the article

  • Regex Pattern for ignoring a custom escape character

    - by user1517464
    I am trying to find a suitable regex for matching pair of custom characters in an input string. These custom characters are replaced by their corresponding html tags. For e.g. The input string can have underscores in pairs to indicate words in bold. Hence, _Name_ outputs as <b>Name</b> However if there is a genuine underscore in the string, it cannot be replaced by "bold" tags and has to be ignored. The genuine underscore has to be preceded by / (I couldn't find a better character, it could be one more underscore or hyphen or whatever). Any single or paired occurrance of this genuine underscore has to be ignored by regex. So far I could come up with this regex: var pattern = @"(?!/)_(.*?)(?!/)_"; But it fails in below input string: _Tom_Katy/_Richard/_/_Stephan_and many users It outputs as <b>Tom</b>Katy/<b>Richard/_/</b>Stephan_and many users Many Thanks in Advance, Pr

    Read the article

  • Escaping escape Characters

    - by Alix Axel
    I'm trying to mimic the json_encode bitmask flags implemented in PHP 5.3.0, here is the string I have: $s = addslashes('O\'Rei"lly'); // O\'Rei\"lly Doing json_encode($str, JSON_HEX_APOS | JSON_HEX_QUOT) outputs the following: "O\\\u0027Rei\\\u0022lly" And I'm currently doing this in PHP versions older than 5.3.0: str_replace(array('\\"', "\\'"), array('\\u0022', '\\\u0027'), json_encode($s)) or str_replace(array('\\"', '\\\''), array('\\u0022', '\\\u0027'), json_encode($s)) Which correctly outputs the same result: "O\\\u0027Rei\\\u0022lly" I'm having trouble understanding why do I need to replace single quotes ('\\\'' or even "\\'" [surrounding quotes excluded]) with '\\\u0027' and not just '\\u0027'.

    Read the article

  • Ruby - Escape Parenthesis

    - by Todd Horrtyz
    I can't for the life of me figure this out, even though it should be very simple. How can I replace all occurrences of "(" and ")" on a string with "\(" and "\)"? Nothing seems to work: "foo ( bar ) foo".gsub("(", "\(") # => "foo ( bar ) foo" "foo ( bar ) foo".gsub("(", "\\(") # => "foo \\( bar ) foo" Any idea?

    Read the article

  • Escape from DataContext

    - by grayscales
    I have a window that get its data from another class that is passed as DataContext. But I now also want to do data binding within the window. The window looks as follows: <Window x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"> <StackPanel> <TextBlock Text="{Binding UserName}" /> <TextBlock x:Name="TestTextBlock">Hello World</TextBlock> <TextBlock x:Name="TestTextBlock2" Text="{Binding ElementName=TestTextBlock,Path=Text}" /> </StackPanel> </Window> The binding between the text blocks TestTextBlock and TestTextBlock2 works fine, but only until I change the DataContext-property of the window. How can I bind between those two textblocks so that changing the DataContext will not break the data binding? Thanks in advance, Stefan

    Read the article

  • Unicode escape characters not being read by XmlReader

    - by craigmoliver
    I've got an XML document that I'm importing into an XmlReader that has some unicode formatting I need to preserve. I'm preserving the whitespace but it's dropping the encoded #x2028 which I assume should be expressed as a line break. Here's my code: var settings = new XmlReaderSettings { ProhibitDtd = false, XmlResolver = null, IgnoreWhitespace = false }; var reader = XmlReader.Create(new StreamReader(fu.PostedFile.InputStream), settings); var document = new XmlDocument {PreserveWhitespace = true}; document.Load(reader); return document;

    Read the article

  • How to implement escape Sequence in SDL

    - by Sa'me Smd
    Im trying to use the STL library inside the SDL. but it gives me the error "undeclared identifier" Is there any way i can use "\n"or even cout<<endl; Can the function SDL_WarpMousewhich places the mouse cursor on a desired location on screen help me with this. Because i want to put a tile on the next line sequence. I hope you get the Question. Its very vague and messed up question though (sorry for that). EDIT: void putMap(SDL_Surface* tile, SDL_Surface* screen) { for(int y = 0; y < 21; y++) { for(int x = 0; x < 60; x++) { if(maze[x][y] != '#') { apply_surface( x*10 , y*10 , tile, screen); } } cout<<endl; } } c:\documents and settings\administrator\my documents\visual studio 2008\projects\craptest\craptest\main.cpp(605) : error C2065: 'cout' : undeclared identifier c:\documents and settings\administrator\my documents\visual studio 2008\projects\craptest\craptest\main.cpp(605) : error C2065: 'endl' : undeclared identifier This is my apply_surface funtion. void apply_surface( int x, int y, SDL_Surface* source, SDL_Surface* destination ) { //Make a temporary rectangle to hold the offsets SDL_Rect offset; //Give the offsets to the rectangle offset.x = x; offset.y = y; //Blit the surface SDL_BlitSurface( source, NULL, destination, &offset ); }

    Read the article

  • regex to escape non-html tags' angle brackets

    - by suad
    Hi I have an html based text (with html tags), I want to find words that occur within angle brackets and replace the brackets with < and > or even when angle brackets are used as math symobls e.g: String text= "Hello, <b> Whatever <br/> <table> <tr> <td width="300px"> 1<2 This is a <test> </td> </tr> </table>"; I want this to be : Hello, <b> Whatever <br/> <table> <tr> <td width="300px"> 1&lt;2 This is a &lt;test&gt; </td> </tr> </table> THANKS in advance

    Read the article

  • need help transforming an XML file, whose part of it is with escape sequences, into html

    - by shlomi
    hello, i need help transforming the following XML <?xml-stylesheet type=text/xsl href=XSL_17.xsl?> <Root> <Book> <Author>John smith</Author> <Genre>Novel</Genre> <Details>&lt;?xml version="1.0" encoding="utf-16"?&gt;&lt;Dets&gt;&lt;Ds&gt;&lt;D DN="Pages" DV="381" /&gt;&lt;D DN="Binding" DV="Hardcover" /&gt;&lt;D DN="Rate" DV="7.8" /&gt;&lt;/Ds&gt;&lt;/Dets&gt;</Details> </Book> <Car> <Year>2010</Year> <Name>Charger</Name> <Manufacturer>Dodge</Manufacturer> </Car> </Root> to the following HTML <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> </head> <body> <table> <tr> <td><strong>Book</strong></td> </tr> <tr> <td><strong>Name</strong></td> <td><strong>Value</strong></td> </tr> <tr> <td>Author</td> <td>John smith</td> </tr> <tr> <td>Genre</td> <td>Novel</td> </tr> <tr> <td>Details</td> <td> <table> <tr> <td><strong>Name</strong></td> <td><strong>Value</strong></td> </tr> <tr> <td>Pages</td> <td>381</td> </tr> <tr> <td>Binding</td> <td>Hardcover</td> </tr> <tr> <td>Rate</td> <td>7.8</td> </tr> </table> </td> </tr> </table> <table> <tr> <td><strong>Car</strong></td> </tr> <tr> <td><strong>Name</strong></td> <td><strong>Value</strong></td> </tr> <tr> <td>Year</td> <td>2010</td> </tr> <tr> <td>Name</td> <td>Charger</td> </tr> <tr> <td>Manufacturer</td> <td>Dodge</td> </tr> </table> </body> </html> i.e. i need to represent both normal XML and escaped XML in HTML tables.

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >