Regex - Special alpha characters? - Python
I have a list of simple names such as Márquez, because of the á (?< name >[a-zA-Z]+) doesn't seem to be working! Help would be very much appreciated! ...
I have a list of simple names such as Márquez, because of the á (?< name >[a-zA-Z]+) doesn't seem to be working! Help would be very much appreciated! ...
Hi, I want to create a string in JavaScript that contains all ascii characters. How can I do this? ...
I know how to replace text in a string. But that's using keyboard (ASCII) characters. In Objective C, how do I indicate a degree symbol? Also, how do I get the ASCII code for a character? ...
My C# project saves files and creates folders with the extended ASCII character "²" (superscript 2). Is this safe to work with internationally? Is this something that could cause any issues with the .NET libraries or Windows functions? ...
I have the following model and instance: class Bashable(models.Model): name = models.CharField(max_length=100) >>> foo = Bashable.objects.create(name=u"piñata") Now I want to be able to search for objects, but using ascii characters rather than unicode, something like this: >>> Bashable.objects.filter(name__lookslike="pinata") ...
I've written a small console application (source below) to locate and optionally rename files containing international characters, as they are a source of constant pain with most source control systems (some background on this below). The code I'm using has a simple dictionary with characters to look for and replace (and nukes every othe...
I am writing a string parser and the thought occurred to me that there might be some really interesting ways to convert an ASCII hexadecimal character [0-9A-Fa-f] to it's numeric value. What are the quickest, shortest, most elegant or most obscure ways to convert [0-9A-Fa-f] to it's value between 0 and 15? Assume, if you like, that the...
I would like to convert this string foo_utf = u'nästy chäräctörs with å and co.' # unicode into this foo_ascii = 'nästy chäräctörs with å and co.' # ASCII . Any idea how to do this in Python (2.6)? I found unicodedata module but I have no idea how to do the transformation. ...
I'm re-writing alibrary with a mandate to make it totally allocation free. The goal is to have 0 collections after the app's startup phase is done. Previously, there were a lot of calls like this: Int32 foo = Int32.Parse(ASCIIEncoding.ASCII.GetString(bytes, start, length)); Which I believe is allocating a string. I couldn't find a ...
Sometimes I get errors while coding, because of typing some combination of keys (eg. ALT + SHIFT + SQUARE BRACKET) in a wrong way. So I get Syntax Error in Python, but I can't see where the illegal character is, 'cause Coda do not show it to me. Any solution? ...
I'm writing a Perl script that reads data from the infamous /dev/input/event* and I didn't find a way to translate the key codes generated by the kernel into ASCII. I'm talking about the linux key codes in this table here and I can't seem to find something that would help me translate them without hardcoding an array into the script. ...
I'm using urllib (in Python) to fetch an SVG file: import urllib urllib.urlopen('http://alpha.vectors.cloudmade.com/BC9A493B41014CAABB98F0471D759707/-122.2487,37.87588,-122.265823,37.868054?styleid=1&viewport=400x231').read() which produces output of the sort: xb6\xf6\x00\xb3\xfb2\xff\xda\xc5\xf2\xc2\x14\xef\xcd\x82\x0b\xdbU\xb0...
I'm looking for a simple and efficient way to store UTF-8 strings in ASCII-7. With efficient I mean the following: all ASCII alphanumeric chars in the input should stay the same ASCII alphanumeric chars in the output the resulting string should be as short as possible the operation needs to be reversable without any data loss the resul...
Hi All, When I added a class with non-Ascii caharacters in the class name, it removed the non-Ascii from class name and when added directly to class it complains of non-Ascii characters. Are Non-ASCII characters not supported in class name and variable name? ...
Hello, I need to convert NSString in unicode to NSString in ASCII changing all local characters: Ą to A, Ś to S, Ó to O, ü to u, And do on... What is the simplest way to do it? ...
From the Python 2.6 shell: >>> import sys >>> print sys.getdefaultencoding() ascii >>> print u'\xe9' é >>> I expected to have either some gibberish or an Error after the print statement, since the "é" character isn't part of ASCII and I haven't specified an encoding. I guess I don't understand what ASCII being the default encoding me...
I've recently decided to undertake an SMS project for sending and receiving SMS though a mobile. The data is sent in PDU format - I am required to change ASCII characters to 7 bit GSM alphabet characters. To do this I've come across several examples, such as http://www.dreamfabric.com/sms/hello.html This example shows Rightmost bits o...
Can someone please help in adding a command for "ENTER" in a .txt file to emulate "ENTER". Example; 12345 "enter" 548793 "ENTER" ..... where an entry will be a number followed by enter to next field where the next number will be inserted etc.. so it will look like this: 12345 548793 etc... ...
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 Maybe stupid but I try: cout << 'U+2662' << endl; I don't know how to write it. ...
How do I to convert different Unicode characters to their closest ASCII equivalents? Like Ä -> A. I googled but didn't find any suitable solution. The trick Encoding.ASCII.GetBytes("Ä")[0] didn't work. (Result was ?). I found that there is a class Encoder that has a Fallback property that is exactly for cases when char can't be convert...