Search Results

Search found 5222 results on 209 pages for 'characters'.

Page 51/209 | < Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >

  • How do I write escape characters verbatim (without escaping) in C# using StreamWriter?

    - by Joel
    I'm writing a utility that takes in a .resx file and creates a javascript object containing properties for all the name/value pairs in the .resx file. This is all well and good, until one of the values in the .resx is This dealer accepts electronic orders. /r/nClick to order {0} from this dealer. I'm adding the name/value pairs to the js object like this: streamWriter.Write(string.Format("\n{0} : \"{1}\"", kvp.Key, kvp.Value)); When kvp.Value = "This dealer accepts electronic orders./r/nClick to order {0} from this dealer." This causes StreamWriter.Write() to actually place a newline in between 'orders.' and 'Click', which naturally screws up my javascript output. I've tried different things with @ and without using string.Format, but I've had no luck. Any suggestions?

    Read the article

  • URL valid characters. java to validate.

    - by Chez
    a string like: 'www.test.com' is good. a string like: 'www.888.com' is good. a string like: 'stackoverflow.com' is good. a string like: 'GOoGle.Com' is good. why ? because those are valid urls. it does not necessarely matter if they have been registered or not. now bad strings are: 'goog*d\x' 'manydots...com' why because you can't register those urls. if I have a string in java which is supposed to be a good url what's the best way to validate it ? thanks a lot

    Read the article

  • Python file input string: how to handle escaped unicode characters?

    - by Michi
    In a text file (test.txt), my string looks like this: Gro\u00DFbritannien Reading it, python escapes the backslash: >>> file = open('test.txt', 'r') >>> input = file.readline() >>> input 'Gro\\u00DFbritannien' How can I have this interpreted as unicode? decode() and unicode() won't do the job. The following code writes Gro\u00DFbritannien back to the file, but I want it to be Großbritannien >>> input.decode('latin-1') u'Gro\\u00DFbritannien' >>> out = codecs.open('out.txt', 'w', 'utf-8') >>> out.write(input)

    Read the article

  • How to pass special characters so ASP.NET MVC can handle correctly query string data?

    - by labilbe
    Hello, I am using a route like this one: routes.MapRoute("Invoice-New-NewCustomer", "Invoice/New/Customer/New/{*name}", new { controller = "Customer", action = "NewInvoice" }, new { name = @"[^\.]*" }); There is an action which handles this route: public ActionResult NewInvoice(string name) { AddClientSideValidation(); CustomerViewData viewData = GetNewViewData(); viewData.InvoiceId = "0"; viewData.Customer.Name = name; return View("New", viewData); } When I call return RedirectToAction("NewInvoice", "Customer", new {name}); and name is equal to "The C# Guy", the "name" parameter is truncated to "The C". So my question is : What is the best way to handle this kind of special character with ASP.NET MVC? Thanks!

    Read the article

  • How do you store accented characters coming from a web service into a database?

    - by Thierry Lam
    I have the following word that I fetch via a web service: André From Python, the value looks like: "Andr\u00c3\u00a9". The input is then decoded using json.loads: >>> import json >>> json.loads('{"name":"Andr\\u00c3\\u00a9"}') >>> {u'name': u'Andr\xc3\xa9'} When I store the above in a utf8 MySQL database, the data is stored like the following using Django: SomeObject.objects.create(name=u'Andr\xc3\xa9') Querying the name column from a mysql shell or displaying it in a web page gives: André The web page displays in utf8: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> My database is configured in utf8: mysql> SHOW VARIABLES LIKE 'collation%'; +----------------------+-----------------+ | Variable_name | Value | +----------------------+-----------------+ | collation_connection | utf8_general_ci | | collation_database | utf8_unicode_ci | | collation_server | utf8_unicode_ci | +----------------------+-----------------+ 3 rows in set (0.00 sec) mysql> SHOW VARIABLES LIKE 'character_set%'; +--------------------------+----------------------------+ | Variable_name | Value | +--------------------------+----------------------------+ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | utf8 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | +--------------------------+----------------------------+ 8 rows in set (0.00 sec) How can I retrieve the word André from a web service, store it properly in a database with no data loss and display it on a web page in its original form?

    Read the article

  • How can I display characters in a map by mapfile?

    - by sirius
    Hello. I'm trying to show a map using postGIS+Mapserver.And I've displayed a PNG picture in my WEB. However, I want to show some charactors in the map, just like this: this is the example from Mapserver Now I'm using database(postgreSQL), but not a shape file. How can I add the charactors then? Here is a part of my mapfile: LAYER CONNECTIONTYPE postgis NAME "state" //Connect to a remote spatial database CONNECTION "user=postgres dbname=*** host=*** password=***" PROCESSING "CLOSE_CONNECTION=DEFER" DATA "the_geom from province" STATUS ON TYPE POLYGON CLASS STYLE COLOR 122 122 122 OUTLINECOLOR 0 0 0 END LABEL COLOR 132 31 31 SHADOWCOLOR 218 218 218 SHADOWSIZE 2 2 TYPE TURETYPE FONT arial-bold SIZE 12 ANTIALIAS TRUE POSITION CL PARTIALS FALSE MINDISTANCE 300 BUFFER 4 END END Some said adding a "TEXT ([*])" in "LABEL", but I don't know howto? Thanks for your help!

    Read the article

  • How can you tell MYSQL to TRIM the X number of characters, beginning from the Back?

    - by Tim
    How do I write the following in MYSQL? SELECT SUBSTRING(value - (1 TRAILING CHARACTER)) FROM table; Basically substring(value, 2) trims the first letters. But I need to trim the last letters. I can't use substring(value, -4, 3) because I don't know the length of the value. Here's another example: SELECT * FROM table WHERE SUBSTRING(value - (4 TRAILING CHARACTER)) in (SELECT SUBSTRING(value - (1 TRAILING CHARACTER)) FROM table);

    Read the article

  • .NET Regex - Replace multiple characters at once without overwriting?

    - by Everaldo Aguiar
    I'm implementing a c# program that should automatize a Mono-alphabetic substitution cipher. The functionality i'm working on at the moment is the simplest one: The user will provide a plain text and a cipher alphabet, for example: Plain text(input): THIS IS A TEST Cipher alphabet: A - Y, H - Z, I - K, S - L, E - J, T - Q Cipher Text(output): QZKL KL QJLQ I thought of using regular expressions since I've been programming in perl for a while, but I'm encountering some problems on c#. First I would like to know if someone would have a suggestion for a regular expression that would replace all occurrence of each letter by its corresponding cipher letter (provided by user) at once and without overwriting anything. Example: In this case, user provides plaintext "TEST", and on his cipher alphabet, he wishes to have all his T's replaced with E's, E's replaced with Y and S replaced with J. My first thought was to substitute each occurrence of a letter with an individual character and then replace that character by the cipherletter corresponding to the plaintext letter provided. Using the same example word "TEST", the steps taken by the program to provide an answer would be: 1 - replace T's with (lets say) @ 2 - replace E's with # 3 - replace S's with & 4 - Replace @ with E, # with Y, & with j 5 - Output = EYJE This solution doesn't seem to work for large texts. I would like to know if anyone can think of a single regular expression that would allow me to replace each letter in a given text by its corresponding letter in a 26-letter cipher alphabet without the need of splitting the task in an intermediate step as I mentioned. If it helps visualize the process, this is a print screen of my GUI for the program:

    Read the article

  • Why am I losing my characters from my html string when trying to add html dynamically using javascri

    - by Hamman359
    I have a page that I am trying to dynamically add some links to. The links are getting added to the page fine, but the '[' and ']' at either end of the line are getting dropped. The code from my .js file is: var html = "[ <a href='#'>Change</a>&nbsp;|&nbsp;<a href='#'>Remove </a> ]"; $(html).appendTo("#id123"); The result I want is: [ <a href='#'>Change</a>&nbsp;|&nbsp;<a href='#'>Remove</a> ] The result I'm getting is: <a href='#'>Change</a>&nbsp;|&nbsp;<a href='#'>Remove</a> If I wrap the line in a <span> tag like so: var html = "<span>[ <a href='#'>Change</a>&nbsp;|&nbsp;<a href='#'>Remove </a> ]</span>"; $(html).appendTo("#id123"); it renders as expected. I set a breakpoint on the code and checked the html var right before the .appendTo and it contains the '[' and ']'. Anyone know why this is happening? Are '[' and ']' special character that need escaped and I'm just forgetting that fact?

    Read the article

  • How to deal with extra space characters while Reading a CSV file?

    - by Ravi Dutt
    I am reading a CSV file with CSV Open Source API. as shown below: Java Code:--> CSVReader reader = new CSVReader(new FileReader(filePath),'\n'); String[] values; if((read=(reader.readNext()))!=null) { values = (read[0].split(" (?=([^\"]*\"[^\"]*\")*[^\"]*$)",-1)).length; } // code ends here When I read this CSV file line by line and split that line with delimiter. Then after spliting values each value I get contains extra space character after each character in String. Suppose value in file is like "ABC" and I got this after reading from CSV file reader as " A B C " . I used removeAll("\s+","") on each value even after it is not working. Thank You in Advance.

    Read the article

  • How can I convert German characters during XML read and PHP write into mysql?

    - by kitenski
    Morning, I am inputting data from an XML file into my database, but have any isse with German words (that are in the XML by mistake) For example the word für appears in my XML as für and thus appears the same in my database. I know I could do a simple search/replace for that exact phrase, but I was wondering if there was a smarter way to do it as I can't predict if any other German words may one day appear in the XML? ADDING SOME MORE DETAIL The XML source says: and in my PHP I have $domString = utf8_encode($dom-saveXML($element)); If I look into the XML file before I start reading it, it has - <title> - <![CDATA[ CoPilot Live v8 Europa für Android 8.0.0.644 ]]> </title> Thanks. Greg

    Read the article

  • text in textbox shows up as circles instead of regular characters?

    - by BlueMonster
    When i type in either of the textboxes i get little circles appearing instead of text. Why is this happening and how do i stop it? Code is as follows: HTML: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MainPage.aspx.cs" Inherits="Foods.MainPage" %> <!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 runat="server"> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link id="Link1" rel="stylesheet" type="text/css" href="Styles/mainStyle.css"/> </head> <body> <form id="form1" runat="server"> <div class = "userIDTboxDiv"> <div class = "userIDTboxText"> &nbsp;&nbsp;&nbsp; Enter User ID: </div> <asp:TextBox id="userIDBox" TextMode="password" runat="server" Height="52px" Width="200px" /> </div> <div class = "passwordTboxDiv"> <div class = "passwordTboxText"> &nbsp;&nbsp;&nbsp; Enter User Password: </div> <asp:TextBox id="TextBox1" TextMode="password" runat="server" Height="52px" Width="200px" /> </div> </form> </body> CSS: body { text-decoration:none; background: white; } input { margin-left: 0px; margin-top: 7px; } .userIDTboxDiv { padding-top: 20%; padding-left: 45%; width: 15%; height: 30%; } .userIDTboxText { padding-left: 17%; height: auto; width:203px; } .passwordTboxDiv { padding-top: 2%; padding-left: 45%; width: 15%; height: 111px; } .passwordTboxText { padding-left: 10%; height: auto; width:203px; }

    Read the article

  • How do you replace many characters in a regex?

    - by macca1
    I am sanitizing an input field and manually getting and setting the caret position in the process. With some abstraction, here's the basic idea: <input type="text" onkeyup"check(this)"> And javascript... function check(element) { var charPosition = getCaretPosition(element); $(element).val( sanitize( $(element).val() ) ); setCaretPosition(element, charPosition); } function sanitize(s) { return s.replace(/[^a-zA-Z0-9\s]/g, ''); } This is working fine except when a character does actually get sanitized, my caret position is off by one. Basically I'd like a way to see if the sanitize function has actually replaced a character (and at what index) so then I can adjust the charPosition if necessary. Any ideas?

    Read the article

< Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >