Search Results

Search found 6155 results on 247 pages for 'escape characters'.

Page 25/247 | < Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >

  • read pair of characters separated by \t c++

    - by Kiran
    Friends, I want to read a pair of characters separated by \t. I want to continue reading the input until user enters z for any of the characters. Here are the options I thought: while (cinch1ch2) { // process ch1 & ch2 } std::string str; while (getline(cin, str) ){ //split string } Also, I want to validate the input to make sure that it is correct. Please suggest the best way. If this is a duplicate, please point me to the right one. Thanks.

    Read the article

  • Turkish characters are not displayed correctly

    - by tfeseas
    MySql database uses utf-8 encoding and data are stored correctly.I use set_name utf8 query to make sure the data called are utf-8 encoded.all variables from database works fine as long as the header charset is utf-8,but the static html characters do not work properly.When i set header charset to ISO-8859-9 variables are displayed differenly while html characters work ok.can anyone help me? <?php header('Content-Type: text/html; charset=ISO-8859-9'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><title>noname</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    Read the article

  • Regex to *not* match any characters

    - by Erick
    I know it is quite some weird goal here but for a quick and dirty fix for one of our system we do need to not filter any input and let the corruption go into the system. My current regex for this is "\^.*" The problem with that is that it does not match characters as planned ... but for one match it does work. The string that make it not work is ^@jj (basically anything that has ^ ... ). What would be the best way to not match any characters now ? I was thinking of removing the \  but only doing this will transform the "not" into a "start with" ...

    Read the article

  • function to remove duplicate characters in a string

    - by Codenotguru
    The following code is trying to remove any duplicate characters in a string.Iam not sure if the code is right??Can anybody help me with the working of the code i.e whats actually happening when there is a match in characters? public static void removeDuplicates(char[] str) { if (str == null) return; int len = str.length; if (len < 2) return; int tail = 1; for (int i = 1; i < len; ++i) { int j; for (j = 0; j < tail; ++j) { if (str[i] == str[j]) break; } if (j == tail) { str[tail] = str[i]; ++tail; } } str[tail] = 0; }

    Read the article

  • Recursively looping through a drive and replacing illegal characters

    - by yeahumok
    Hi I have to create an app that drills into a specific drive, reads all file names and replaces illegal SharePoint characters with underscores. The illegal characters I am referring to are: ~ # % & * {} / \ | : <> ? - "" Can someone provide either a link to code or code itself on how to do this? I am VERY new to C# and need all the help i can possibly get. I have researched code on recursively drilling through a drive but i am not sure how to put the character replace and the recursive looping together. Please help!

    Read the article

  • using regular expression / Remove special characters with linq to sql

    - by Prasad
    How can i use regular expressions with linq to sql in the asp.net mvc(C#) application? The columns in my MSSQL table (Products) has some special characters like (, - % ',.....). While searching for a product i need to search without that special chareters. For ex.: I have a product say (ABC-Camp's / One), when i search for "abccamp", it should pull the product. I am trying the query like: from p in _context.pu_Products where p.User_Id == userId && p.Is_Deleted == false && p.Product_Name.ToLower().Contains(text.ToLower()) select new Product { ProductId = p.Product_Id, ProductName = p.Product_Name.Replace("’", "").Replace("\"", ""), RetailPrice = p.Retail_Price ?? 0M, LotSize = p.Lot_Size > 0 ? p.Lot_Size ?? 1 : 1, QuantityInHand = p.Quantity_In_Hand ?? 0 } But i need to search without any special characters...

    Read the article

  • Print unique ascii characters in eclipse console

    - by Shaded
    Hey guys, Kind of a strange question but... here it goes. Recently my application threw an IOException that the text only had a clubs symbol in it (like the suit in cards) I know this is probably because there was a number in there that was cast to a char and printed to the screen, and I've found where that might have happened. The only problem is, I can't recreate it in eclipse because the eclipse console doesn't want to print those characters for me. All I get are boxes. I figure this is an encoding issue or something but I need eclipse to print out those characters just like the windows console would. Is there a setting I can change to do this?

    Read the article

  • PHP & RSS Feeds & Special Characters validation Problem.

    - by BUGY
    I keep getting the following validation warning below. And I was wondering that some of my articles deal with special characters and was wondering how should I go about rendering or not rendering special characters in my RSS feeds? Should I use htmlentites or not? If so how? In addition, interoperability with the widest range of feed readers could be improved by implementing the following recommendations. line 22, column 35: title should not contain HTML: &amp; PHP code. <title>' . htmlentities(strip_tags($title), ENT_QUOTES, "UTF-8") . '</title>

    Read the article

  • Discard unprintable characters returned in server's XML response

    - by Penang
    While trying to use the Bing API to search, I am getting characters that are not printable and do not seem to hold any extra information. The goal is to save the XML (UTF-8) response as a text file to be parsed later. My code currently looks something like this: URL url = new URL(queryURL); BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream())); BufferedWriter out = new BufferedWriter(new FileWriter(query+"-"+saveResultAs)); String str = in.readLine(); out.write(str); in.close(); out.close(); When I send the contents of 'str' to console it looks something like this: and here's a what the newly created local XML file looks like: What should I be doing to convert the UTF-8 text so that str does not have the extra characters?

    Read the article

  • PHP: Return string between two characters

    - by Nic Hubbard
    I am wanting to use "keywords" within a large string. These keywords start and end using *my_keyword* and are user defined. How, within a large string, can I search and find what is between the two * characters and return each instance? The reason it might change it, that parts of the keywords can be user defined, such as *page_date_Y* which might show the year in which the page was created. So, again, I just need to do a search and return what is between those * characters. Is this possible, or is there a better way of doing this if I don't know the "keyword" length or what i might be?

    Read the article

  • counting characters program in c

    - by mena
    Hello, the output of characters number is the actual no. plus 3 i don't know why? This is the code: void main(void) { int ch,w=0,c=0; do { ch=getche(); ++c; if(ch==32) { ++w; ++c; } }while(ch!=13); printf("\nnum of characters is %d",c); printf("\nnum of words is %d",w); getch(); }

    Read the article

  • Which character is first among 4 characters in c++

    - by Ashiqur Rahman
    In my project I take a string from user and then I need to check if vowels a, e, I, O, U are present. If so, I have to find out which one comes first in the string and which one comes next after that. For example, if a user gave input something like this: char expr[] = "this is for something real"; I comes first, then I again, then O and so on. I checked whether the characters are in the string or not using strchr(expr,'character here'). To find which character comes first, I find the index of each character using const char *ptr = strchr(expr, characters here); if(ptr) { int index = ptr - expr; } After that I check which index is bigger. But this is very long process. Is there a smarter way to do this?

    Read the article

  • Need to add specific characters to regular expression

    - by lordryan
    i'm using the following regular expression to form a basic email validation. var emailRegEx = /^([a-zA-Z0-9])(([a-zA-Z0-9])*([\._\+-])*([a-zA-Z0-9]))*@(([a-zA-Z0-9\-])+(\.))+([a-zA-Z]{2,4})+$/; this works pretty well for what i need but i also need to exclude these specific characters for reasons i won't go into. !,#,$,%,^,&,*,(,),-,+,|,{,},[,],:,>,<,?,/,\,= - (the characters between the "," if that isn't clear) could someone help me with adding the second group to the first? I know the pro's and cons of using javascript to validate email addresses - i have to do it this way. thanks.

    Read the article

  • URL decoding Japanese characters etc. in Java

    - by DanieL
    I have a servlet that receives some POST data. Because this data is x-www-form-urlencoded, a string such as ???? would be encoded to &#12469;&#12508;&#12486;&#12531;. How would I unencode this string back to the correct characters? I have tried using URLDecoder.decode("encoded string", "UTF-8"); but it doesn't make a difference. The reason I would like to unencode them, is because, before I display this data on a webpage, I escape & to &amp; and at the moment, it is escaping the &s in the encoded string so the characters are not showing up properly.

    Read the article

  • Different characters take more/less data?

    - by Nathan
    I am working on a personal project and I'm wondering if certain characters take up more data in a text file than others. I need to choose a character to seperate items in my file, but if a 0 uses less bytes than a ! or something, it would be best to do that. I know all characters have an ASCII value, but would a lower ASCII value mean the character can be stored in fewer bytes? This might be an incredibly stupid question, but I don't see any information on the topic online so I came here to check. Thanks!

    Read the article

  • PHP string enocding issue - Extra characters appearing

    - by ryan
    I see extra characters like â showing because of encoding issues as I found out here - HTML encoding issues - "Â" character showing up instead of "&nbsp;" I understand that if I set the browser meta encoding to UTF-8, these will not affect anything but I need to strip these extra characters from the database for other purposes. For eg. : Text: ↑ should be become Text: ? But if I run it through utf8_decode it gives me Text: ??? For every other occurrence of the â character, it converts properly to a blank space. Any help will be appreciated.

    Read the article

  • Java, UnmarshallingException caused by XML attribute with special chars: ;ìè+òàù-<^èç°§_>!£$%&/()=?~

    - by segolas
    Hi, my xml file has a tag with an attribute "containsValue" which contains the "special" characters you can see in the subject: <original_msg_body id="msgBodySpecialCharsRule" containsValue=";ìè+òàù-<^èç°§_>!£$%&/()=?~`'#;" /> in my xml schema the attribute has xs:string: <xs:attribute name="containsValue" type="xs:string" /> I use this value inside a Java software which check if this value is contained inside another String. but I always obtain this Exception: javax.xml.bind.UnmarshalException - with linked exception: [org.xml.sax.SAXParseException: The value of attribute "containsValue" associated with an element type "original_msg_body" must not contain the '<' character.] How can I solve it? I've tried changing the attribute type to xs:NMTOKEN, ut I get the same exception. Is there any other type? I think I could change the characters encoding, for example using the HTML representation, like <, but than could be tricky for the string comparison...

    Read the article

  • MYSQL accentuated characters é display as %E9

    - by Jk_
    Hi guys, I'm pushing data from as3 to MSQL through a little php script! My problem is that all my accentuated characters are displayed as weird iso characters. Example : é is displayed %E9 Obvisously the collation of my field is set to utf8_general_ci Even when I try to INSERT the data from a simple php script without as3, I get the same mistake. <?php mysql_connect("***", "***", "***") or die("Error :" .mysql_error()); mysql_select_db("***"); $query ="INSERT INTO test (message) values ('éèàïû')"; mysql_query($query) or die("Error updating DB"); ?> Any idea on what am I doing wrong and how I could fix that? Thanks in advance. Jk_

    Read the article

  • Ruby on Rails: How to sanitize a string for SQL when not using find?

    - by williamjones
    I'm trying to sanitize a string that involves user input without having to resort to manually crafting my own possibly buggy regex if possible, however, if that is the only way I would also appreciate if anyone can point me in the right direction to a regex that is unlikely to be missing anything. There are a number of methods in Rails that can allow you to enter in native SQL commands, how do people escape user input for those? The question I'm asking is a broad one, but in my particular case, I'm working with a column in my Postgres database that Rails does not natively understand as far as I know, the tsvector, which holds plain text search information. Rails is able to write and read from it as if it's a string, however, unlike a string, it doesn't seem to be automatically escaping it when I do things like vector= inside the model. For example, when I do model.name='::', where name is a string, it works fine. When I do model.vector='::' it errors out: ActiveRecord::StatementInvalid: PGError: ERROR: syntax error in tsvector: "::" "vectors" = E'::' WHERE "id" = 1 This seems to be a problem caused by lack of escaping of the semicolons, and I can manually set the vector='\:\:' fine. I also had the bright idea, maybe I can just call something like: ActiveRecord::Base.connection.execute "UPDATE medias SET vectors = ? WHERE id = 1", "::" However, this syntax doesn't work, because the raw SQL commands don't have access to find's method of escaping and inputting strings by using the ? mark. This strikes me as the same problem as calling connection.execute with any type of user input, as it all boils down to sanitizing the strings, but I can't seem to find any way to manually call Rails' SQL string sanitization methods. Can anyone provide any advice?

    Read the article

  • Ruby on Rails: How to sanitize a string for SQL when not using find and other built-in methods?

    - by williamjones
    I'm trying to sanitize a string that involves user input without having to resort to manually crafting my own possibly buggy regex if possible. There are a number of methods in Rails that can allow you to enter in native SQL commands, how do people escape user input for those? The question I'm asking is a broad one, but in my particular case, I'm working with a column in my Postgres database that Rails does not natively understand as far as I know, the tsvector, which holds plain text search information. Rails is able to write and read from it as if it's a string, however, unlike a string, it doesn't seem to be automatically escaping it when I do things like vector= inside the model. For example, when I do model.name='::', where name is a string, it works fine. When I do model.vector='::' it errors out: ActiveRecord::StatementInvalid: PGError: ERROR: syntax error in tsvector: "::" "vectors" = E'::' WHERE "id" = 1 This seems to be a problem caused by lack of escaping of the semicolons, and I can manually set the vector='\:\:' fine. I also had the bright idea, maybe I can just call something like: ActiveRecord::Base.connection.execute "UPDATE medias SET vectors = ? WHERE id = 1", "::" However, this syntax doesn't work, because the raw SQL commands don't have access to find's method of escaping and inputting strings by using the ? mark. This strikes me as the same problem as calling connection.execute with any type of user input, as it all boils down to sanitizing the strings, but I can't seem to find any way to manually call Rails' SQL string sanitization methods. Can anyone provide any advice?

    Read the article

< Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >