Search Results

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

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

  • Quote POSIX shell special characters in Python output

    - by ??O?????
    There are times that I automagically create small shell scripts from Python, and I want to make sure that the filename arguments do not contain non-escaped special characters. I've rolled my own solution, that I will provide as an answer, but I am almost certain I've seen such a function lost somewhere in the standard library. By “lost” I mean I didn't find it in an obvious module like shlex, cmd or subprocess. Do you know of such a function in the stdlib?

    Read the article

  • Escaped International characters?

    - by FFish
    I am looking at some PHP code where there are translation strings. For French there are characters that I have never seen before and I am asking if someone could shed a light. These strings are used as HTML output, but also as body text to send emails. È = é Ë = è ‡ = à Í = ê ...

    Read the article

  • XmlWriter and lower ASCII characters

    - by Rick Strahl
    Ran into an interesting problem today on my CodePaste.net site: The main RSS and ATOM feeds on the site were broken because one code snippet on the site contained a lower ASCII character (CHR(3)). I don't think this was done on purpose but it was enough to make the feeds fail. After quite a bit of debugging and throwing in a custom error handler into my actual feed generation code that just spit out the raw error instead of running it through the ASP.NET MVC and my own error pipeline I found the actual error. The lovely base exception and error trace I got looked like this: Error: '', hexadecimal value 0x03, is an invalid character. at System.Xml.XmlUtf8RawTextWriter.InvalidXmlChar(Int32 ch, Byte* pDst, Boolean entitize)at System.Xml.XmlUtf8RawTextWriter.WriteElementTextBlock(Char* pSrc, Char* pSrcEnd)at System.Xml.XmlUtf8RawTextWriter.WriteString(String text)at System.Xml.XmlWellFormedWriter.WriteString(String text)at System.Xml.XmlWriter.WriteElementString(String localName, String ns, String value)at System.ServiceModel.Syndication.Rss20FeedFormatter.WriteItemContents(XmlWriter writer, SyndicationItem item, Uri feedBaseUri)at System.ServiceModel.Syndication.Rss20FeedFormatter.WriteItem(XmlWriter writer, SyndicationItem item, Uri feedBaseUri)at System.ServiceModel.Syndication.Rss20FeedFormatter.WriteItems(XmlWriter writer, IEnumerable`1 items, Uri feedBaseUri)at System.ServiceModel.Syndication.Rss20FeedFormatter.WriteFeed(XmlWriter writer)at System.ServiceModel.Syndication.Rss20FeedFormatter.WriteTo(XmlWriter writer)at CodePasteMvc.Controllers.ApiControllerBase.GetFeed(Object instance) in C:\Projects2010\CodePaste\CodePasteMvc\Controllers\ApiControllerBase.cs:line 131 XML doesn't like extended ASCII Characters It turns out the issue is that XML in general does not deal well with lower ASCII characters. According to the XML spec it looks like any characters below 0x09 are invalid. If you generate an XML document in .NET with an embedded &#x3; entity (as mine did to create the error above), you tend to get an XML document error when displaying it in a viewer. For example, here's what the result of my  feed output looks like with the invalid character embedded inside of Chrome which displays RSS feeds as raw XML by default: Other browsers show similar error messages. The nice thing about Chrome is that you can actually view source and jump down to see the line that causes the error which allowed me to track down the actual message that failed. If you create an XML document that contains a 0x03 character the XML writer fails outright with the error: '', hexadecimal value 0x03, is an invalid character. The good news is that this behavior is overridable so XML output can at least be created by using the XmlSettings object when configuring the XmlWriter instance. In my RSS configuration code this looks something like this:MemoryStream ms = new MemoryStream(); var settings = new XmlWriterSettings() { CheckCharacters = false }; XmlWriter writer = XmlWriter.Create(ms,settings); and voila the feed now generates. Now generally this is probably NOT a good idea, because as mentioned above these characters are illegal and if you view a raw XML document you'll get validation errors. Luckily though most RSS feed readers however don't care and happily accept and display the feed correctly, which is good because it got me over an embarrassing hump until I figured out a better solution. How to handle extended Characters? I was glad to get the feed fixed for the time being, but now I was still stuck with an interesting dilemma. CodePaste.net accepts user input for code snippets and those code snippets can contain just about anything. This means that ASP.NET's standard request filtering cannot be applied to this content. The code content displayed is encoded before display so for the HTML end the CHR(3) input is not really an issue. While invisible characters are hardly useful in user input it's not uncommon that odd characters show up in code snippets. You know the old fat fingering that happens when you're in the middle of a coding session and those invisible characters do end up sometimes in code editors and then end up pasted into the HTML textbox for pasting as a Codepaste.net snippet. The question is how to filter this text? Looking back at the XML Charset Spec it looks like all characters below 0x20 (space) except for 0x09 (tab), 0x0A (LF), 0x0D (CR) are illegal. So applying the following filter with a RegEx should work to remove invalid characters:string code = Regex.Replace(item.Code, @"[\u0000-\u0008,\u000B,\u000C,\u000E-\u001F]", ""); Applying this RegEx to the code snippet (and title) eliminates the problems and the feed renders cleanly.© Rick Strahl, West Wind Technologies, 2005-2012Posted in .NET  XML   Tweet !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs"); (function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/plusone.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })();

    Read the article

  • Encoding Problem with Zend Navigation using Zend Translate Spanish in XMLTPX File Special Characters

    - by Routy
    Hello, I have been attempting to use Zend Translate to display translated menu items to the user. It works fine until I introduce special characters into the translation files. I instantiate the Zend_Translate object in my bootstrap and pass it in as a translator into Zend_Navigation: $translate = new Zend_Translate( array('adapter' => 'tmx', 'content' => APPLICATION_PATH .'/languages/translation.tmx', 'locale' => 'es' ) ); $navigation->setUseTranslator($translate); I have used several different adapters (array,tmx) in order to see if that made a difference. I ended up with a TMX file that is encoded using ISO-8859-1 (otherwise that throws an XML parse error when introducing the menu item "Administrar Applicación". <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE tmx SYSTEM "tmx14.dtd"> <tmx version="1.4"> <header creationtoolversion="1.0.0" datatype="tbx" segtype="sentence" adminlang="en" srclang="en" o-tmf="unknown" creationtool="XYZTool" > </header> <body> <tu tuid='link_signout'> <tuv xml:lang="en"><seg>Sign Out</seg></tuv> <tuv xml:lang="es"><seg>Salir</seg></tuv> </tu> <tu tuid='link_signin'> <tuv xml:lang="en"><seg>Login</seg></tuv> <tuv xml:lang="es"><seg>Acceder</seg></tuv> </tu> <tu tuid='Manage Application'> <tuv xml:lang="en"><seg>Manage Application</seg></tuv> <tuv xml:lang="es"><seg>Administrar Applicación</seg></tuv> </tu> </body> </tmx> Once I display the menu in the layout: echo $this->navigation()->menu(); It will display all menu items just fine, EXCEPT the one using special characters. It will simply be blank. NOW - If I use PHP's UTF8-encode inside of the zend framework class 'Menu' which I DO NOT want to do: Line 215 in Zend_View_Helper_Navigation_Menu: if ($this->getUseTranslator() && $t = $this->getTranslator()) { if (is_string($label) && !empty($label)) { $label = utf8_encode($t->translate($label)); } if (is_string($title) && !empty($title)) { $title = utf8_encode($t->translate($title)); } } Then it works. The menu item display correctly and all is joyful. The thing is, I do not want to modify the library. Is there some kind of an encoding setting in either zend translate or zend navigation that I am not finding? Please Help! Zend Library Version: 1.11

    Read the article

  • PHP Special Characters Test

    - by pws5068
    What's an efficient way of checking if a username contains a number of special characters that I define. Examples: % # ^ . ! @ & ( ) + / " ? ` ~ < { } [ ] | = - ; I need to detect them and return a boolean, not just strip them out. Probably a super easy question but I need a better way of doing this than a huge list of conditionals or a sloppy loop.

    Read the article

  • Special characters in PHP / MySQL

    - by Jonathan
    Hi, I have in the database words that include special character (in Spanish mostly, like tildes). In the database everything is saved and shown correctly with PHPmyAdmin, but when I get the data (using PHP) and display it in a browser, I get a weird character, like a "?" with a square... I need a general fix so I don't need to escape each character every time, and also I would be able to insert special Spanish characters from a PHP form into the database... The HTML is correct: <meta http-equiv="content-type" content="text/html; charset=utf-8" /> All tables and databas are set to utf8_spanish The character I get: ? Any suggestions??? Thanks!!!

    Read the article

  • Jquery Table sorter and special characters

    - by kevin
    Hi there, am using jquery tablesorter plugin and in my "country" column i got special characters like this: Índia. The fact is that when i hit the header of the column to sort it, it puts my "Índia" at the end of the column. I guess the nav sees the Í instead of the real "I" with an accent. Any clue on how to make it work even with accents ? Here's the js code in my domready: $.tablesorter.defaults.widgets = ['zebra']; $.tablesorter.defaults.sortList = [[0,0]]; $("table").tablesorter(); Thanks in advance.

    Read the article

  • weird characters in HTML email

    - by sims
    Hi stackers! I'm reading email from a maildir and some emails have weird sets of characters in them: =3D =09 I think =3D is = and =09 is a space. There are some others, but I'm not sure: =E2 =80 =93 Does anyone know what these are and what encoding issues I'm dealing with here? BTW, I tried fetching these email via POP3 and it's the same thing. The reason I'm posting this on SO is not because I'm using a regular mail client to read the data. I'm reading via PHP out of maildir files. Perhaps a regular email client would detect what encoding this is and deal with it. Thanks!

    Read the article

  • Caesar Cipher in Java (Spanish Characters)

    - by Rodolfo
    I've reading this question, and I was wondering if Is there any way to consider the whole range of characters? For example, "á", "é", "ö", "ñ", and not consider " " (the [Space])? (For example, my String is "Hello World", and the standard result is "Khoor#Zruog"; I want to erase that "#", so the result would be "KhoorZruog") I'm sure my answer is in this piece of code: if (c >= 32 && c <= 127) { // Change base to make life easier, and use an // int explicitly to avoid worrying... cast later int x = c - 32; x = (x + shift) % 96; chars[i] = (char) (x + 32); } But I've tried some things, and it didn't work.

    Read the article

  • Generating the permutations from a number of Characters

    - by adam08
    I'm working on a predictive text solution and have all the words being retrieved from a Trie based on input for a certain string of characters, i.e. "at" will give all words formed with "at" as a prefix. The problem that I have now, is that we are also supposed to return all other possibilities from pressing these 2 buttons, Button 2 and button 8 on the mobile phone, which would also give words formed with, "au, av, bt, bu, bv, ct, cu, cv" (most of which won't have any actual words. Can anyone suggest a solution and how I would go about doing this for calculating the different permutations? (at the moment, I'm prompting the user to enter the prefix (not using a GUI right now)

    Read the article

  • MySQL update error when special characters are used

    - by Katy
    Hi All, I was wondering if anyone had come across this one before. I have a customer who uses special characters in their product description field. Updating to a MySQL database works fine if we use their HTML equivalents but it fails if the character itself is used (copied from either character map or Word I would assume). Has anyone seen this behaviour before? The character in question in this case is ø - and we can't seem to do a replace on it (in ASP at least) as the character comes though to the SQL string as a "?". Any suggestions much appreciated - thanks!

    Read the article

  • MSBuild - Writing Escape Characters to Files

    - by Richm7
    I've got a very similar scenario to the one described in this post. It describes how to load the contents of a file that contains properties & items, making sure they're resolved as part of the process. I'm doing the same thing except writing the contents away to another text file (generally .ini file). In short I'd start by importing a project / propertygroup which contains this text: ; ----------- [heading] setting1=$(FirstValue) setting2=$(SecondValue) setting3=list;of;values;delimited;by;semicolons setting4=bla bla bla ; ----------- & hopefully write it away to a new .ini file containing the following: ; ----------- [heading] setting1=value resolved by msbuild setting2=another value resolved by msbuild setting3=list;of;values;delimited;by;semicolons setting4=bla bla bla ; ----------- Only problem is that some files will contain semicolons. I can live without comments, but they're also used as part of values e.g. in lists. This is the result of using the WriteLinesToFile task. The semicolons are treated as escape characters & result in new lines, so the value of 'setting3' in the above example would be split over 6 lines. Is there a way around this without implementing my own task? Thanks in advance for the help!

    Read the article

  • Characters in usernames that cause trouble

    - by acidzombie24
    I am testing out security and reliability issues on my site. I have made \n and \r illegal. I created a user with null in the name which caused my PM system to not message the user. However \b worked and \t didnt allow copy/paste to work correctly. The browser (firefox which i am testing with) copied the tab as a single space causing the name not to be the same thus not recognizing the username. Since i cant copy paste easily i'll probably disallow it. \f works as well although i do see a symbol in the title but nowhere else because of the \f. What else should i try? It appears 0-31 127-159 (i dont understand this range) are illegal. What characters in legal range might i want to disallow? I heard there was a 0 width character space. That may be something i want to disallow? What else is there?

    Read the article

  • Illegal characters for SharePoint 2010 Content Type name

    - by Kelly Jones
    Quick tip: you can’t include a backslash in the name of the SharePoint 2010 Content Type.  In fact, there are several illegal characters:  \  / : * ? " # % < > { } | ~ & , two consecutive periods (..), or special characters such as a tab. What, you didn’t know that after entering one of these characters in the name?  Is it because you saw this screen: Oh, that’s right….you need to turn off custom errors in the layouts folder…See this blog post for details and you’ll also need to turn off for the web application. Once you do that, you’ll see this: I wonder why the SharePoint team just doesn’t let the user know that the content type name contains illegal characters before the user hits the create button. Here’s a copy of the complete error (for the search engines): Server Error in '/' Application. -------------------------------------------------------------------------------- The content type name 'asdfadsf\asdfasf' cannot contain: \  / : * ? " # % < > { } | ~ & , two consecutive periods (..), or special characters such as a tab. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: Microsoft.SharePoint.SPInvalidContentTypeNameException: The content type name 'asdfadsf\asdfasf' cannot contain: \  / : * ? " # % < > { } | ~ & , two consecutive periods (..), or special characters such as a tab. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  Stack Trace: [SPInvalidContentTypeNameException: The content type name 'asdfadsf\asdfasf' cannot contain: \  / : * ? " # % < > { } | ~ & , two consecutive periods (..), or special characters such as a tab.]    Microsoft.SharePoint.SPContentType.ValidateName(String name) +27419522    Microsoft.SharePoint.SPContentType.ValidateNameWithResource(String strVal, String& strLocalized) +423    Microsoft.SharePoint.SPContentType.set_Name(String value) +151    Microsoft.SharePoint.SPContentType.Initialize(SPContentType parentContentType, SPContentTypeCollection collection, String name) +112    Microsoft.SharePoint.SPContentType..ctor(SPContentType parentContentType, SPContentTypeCollection collection, String name) +132    Microsoft.SharePoint.ApplicationPages.ContentTypeCreatePage.BtnOK_Click(Object sender, EventArgs e) +497    System.Web.UI.WebControls.Button.OnClick(EventArgs e) +115    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +140    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981   -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927

    Read the article

  • How do I correctly display special characters in my Firefox browser?

    - by BrianH
    (Firefox 3.6.13 on Windows XP) Every once in a while I notice an odd character on certain web pages when browsing the web. It is a outline of a box with a 4-digit number inside. And example of a page that has these characters is: http://aws.amazon.com/ec2/#highlights After each section heading (Elastic, Completely Controlled, ...) I see a box with the number "0096" inside. I looked at the cached version on Google, and google has &ndash; in it's place, so I'm guessing I should be seeing a dash there instead of the box with the numbers in it. I have tried changing the character encoding in Firefox but haven't been able to find one that shows these characters correctly. Is there a way to allow Firefox to view these characters? Thanks in advance!

    Read the article

  • Regex, encoding, and characters that look a like

    - by hack.augusto
    First, a brief example, let's say I have this "/[0-9]{2}°/" regex and this text "24º". The text won't match, obviusly ... (?) really, it depends on the character encoding. Here is my problem, I do not have control on which chars the user uses, so, I need to cover all possibilities in the regex /[0-9]{2}[°º]/, or even better, assure that the text has only the chars I'm expecting °. But I can't just remove the unknow chars otherwise the regex won't work, I need to change it to the chars that looks like it and I'm expecting. I have done this through a little function that maps the "look like" to "what I expect" and change it, the problem is, I have not covered all possibilities, for example, today I found a new "-", now we got three of them, just like latex =D - -- --- ,cool , but the regex didn't work. Does anyone knows how I might solve this?

    Read the article

  • Freely available dictionary data for Chinese, Japanese, CJK characters

    - by devio
    I am developing an online CJK character dictionary application, and already found the following databases: Unicode Unihan Database Jim Breen's JMDict and KanjiDic CEDict HanDeDict As I am looking for more data, web searches often lead me to online dictionaries, but not the data itself, using the same sources over again. If you know of any CJK-relevant downloadable dictionaries, please add them.

    Read the article

  • URL encoding for latin characters in Java

    - by sammichy
    I'm trying to read in an image URL. As mentioned in the java documentation, I tried converting the URL to URI by String imageURL = "http://www.shefinds.com/files/Christian-Louboutin-Décolleté-100-pumps.jpg"; URL url = new URL(imageURL); url = new URI(url.getProtocol(), url.getHost(), url.getFile(), null).toURL(); URLConnection conn = url.openConnection(); InputStream is = conn.getInputStream(); I get the following error when the code is executed http://www.shefinds.com/files/Christian-Louboutin-Décolleté-100-pumps.jpg What am I doing wrong and what is the right way to encode this URL?

    Read the article

  • Unicode replacement characters for text matching

    - by Christian Harms
    I have some fun with unicode text sources (all correct encodet) and I want to match names. The classic problem, one source comes correctly, an other has more flatten names: "Elblag" vs. "Elblag" (see the character a) How can I "flatten" a, á, â or à to a for better matching? Are there unicode to ascii- matching tables?

    Read the article

  • .aspx character coding

    - by kwek-kwek
    I am having an problem. First time working with a windows server, do you know if there is any problem in character coding? My document is set to content="text/html; charset=UTF-8" but it's giving me funny words... you can check it here. This site is a pure HTML with few includes but anything else is just HTML. I can convert them to HTML entities but that is basically wasting my time. I never had this problem with any website I did except for this. Some others said "The problems seems to be that you have converted the text into utf-8 twice.". But how would Coverted it twice since dreamweaver should convert it for me but in this case it doesn't.

    Read the article

  • Special Characters on Console

    - by pocoa
    I've finished my poker game but now I want to make it look a bit better with displaying Spades, Hearts, Diamonds and Clubs. I tried this answer: http://stackoverflow.com/questions/2094366/c-printing-ascii-heart-and-diamonds-with-platform-independent But I couldn't make it work. I'm running on Windows.

    Read the article

  • Replacing characters with specified one

    - by mahesh
    Hello All, I have a string as follows - MFMFMF now i want to change this string to FMFMFM how to do this , help needed pls i had tried select replace(replace('mfmfmf','M','F'),'F','M') this gives me result - MMMMMM which i donot what i want the output to be FMFMFM Need your help D.Mahesh

    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

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