character

Python: loop over consecutive characters?

In Python (specifically Python 3.0 but I don't think it matters), how do I easily write a loop over a sequence of characters having consecutive character codes? I want to do something like this pseudocode: for Ch from 'a' to 'z' inclusive: # f(Ch) Example: how about a nice "pythonic" version of the following? def Pangram(Str): ...

Creating a PostScript/TrueType font.

I've the coordinates of the letters (e.g. using SVG). How could I generate a TrueType/PostScript font for my computer ? (edited : changed vectorial to TrueType/PostScript ) ...

Show tabs with a different character (Emacs)

I'd be happy to have very soft character ">>" instead of white-space, like this: Any idea how to achieve that in Emacs? thanks ...

Wildcard character in CHECK in Create table taken as string

I created an info table that stores employee record, the SQL query for it as follows... CREATE TABLE info1 (empid VARCcHAR(8) PRIMARY KEY CONSTRAINT empchk CHECK (empid IN ('kh\%' ESCAPE '\''), initials CHAR(6), fname CHAR(25) NOT NULL, lname CHAR(25), userstatus INTEGER NOT NULL, designation CHAR(10) NOT NULL); Now, as...

Array of Strings in Fortran 77

I've a question about Fortran 77 and I've not been able to find a solution. I'm trying to store an array of strings defined as the following: character matname(255)*255 Wich is an array of 255 strings of length 255. Later I read the list of names from a file and I set the content of the array like this: matname(matcount) = mname ...

Character conversion in SAXParser

I have a problem … a very peculiar one could you please guide. Original message: Kevätsunnuntaisin lentää The flow of data is HttpConnector -> WSDLConnector -> to the underlying system The following is the encoding of the first 7 characters 4b 65 76 c3 a4 74 73 75 – In Http Connector – the request XML has UTF-8 encoding 4b 65 76 a3 ...

How to export pound symbol from a C# Web App to Excel correctly? (£ is produced instead of £)

We're exporting some data from a website app into an Excel spreadsheet, however, when a GBP symbol is used, instead of outputting "£9.99" it produces "£9.99". Here's the code a colleague has written to produce the spreadsheet [tableOut is a StringBuilder that contains an HTML table]: string filename = "EngageReplies.xls"; Response.Cle...

How do I read input character-by-character in Java?

I am used to the c-style getchar(), but it seems like there is nothing comparable for java. I am building a lexical analyzer, and I need to read in the input character by character. I know I can use the scanner to scan in a token or line and parse through the token char-by-char, but that seems unwieldy for strings spanning multiple line...

Is there a function that returns the ASCII value of a character? (C++)

I need a function that returns the ASCII value of a character, including spaces, tabs, newlines, etc... On a similar note, what is the function that converts between hexadecimal, decimal, and binary numbers? ...

database physical storage for character type

Hello everyone, For SQL Server 2005/2008, after some self-study, I am not sure whether my understanding about how character data type is physically stored is correct. Please help to review and comment. Here is my understanding, please review and feel free to correct me. when using unicode character type (e.g. nvarchar), underlying cha...

Character encoding confusion!

Hi, Having some issues getting my head around the differences between UTF-8, UTF-16, ASCII and ANSI. After doing some research I have some idea but it would be really useful if someone could explain exactly the difference between them (including the byte representation of a typical character from each). I quess my question boils down t...

escape character via serial

Hi, I'm controlling a serial printer from arduino, now it works perfect but i need to send it escape characters to controll some especific features of the printer. Anybody can show me a way to do that? i need to send "ESC i" thx ...

Split SMS gateway answer in PHP

Hi I am wondering what other approaches you would take to do some simple string splitting in PHP. I am receiving a response from a SMS gateway where two of the interesting values are the code used and the users text message. The code could be something like: Freetrip (lowercase, uppercase, mixed case) The user message should in the be...

How can I convert character references to UTF-8 strings in Ruby?

I have some content from feeds. In these feeds, UTF-8 characters are often encoded as character references, ie "å" is "å". To avoid double encoding these in my views (ie "å") I want to convert these back to normal UTF_8 characters. How can I do this in Ruby? I want: "å".convert_to_utf8 => "å" ...

How to use escape character in replace function when replacing quotations in VB

Here is my code snippet: Public Function convert(ByVal robert As String) Try robert = Replace(robert, "U", "A") robert = Replace(robert, "\"", "A") I want to actually replace the "quotations" with the A but the program doesn't seem to recognize the fact that I'm using an escape character in VB. Does a...

How to use replace when making one variable = two others instead of just one

Okay this one might be a little tougher. I'm using VB that looks like this: string = Replace(string.ToLower, chr(63), "A") But I also want chr(63) = "B" as well, like this: string = Replace(string.ToLower, chr(63), "B") My problem is that when chr(63) is at the end of a string I need it to be B, and when it's not the end I need it...

Why don't popular programming languages use some other character to delimit strings?

Every programming language I know (Perl, Javascript, PHP, Python, ASP, ActionScript, Commodore Basic) uses single and double quotes to delimit strings. This creates the ongoing situation of having to go to great lengths to treat quotes correctly, since the quote is extremely common in the contents of strings. Why do programming languag...

mysql varbinary vs varchar

Hi, We use varchar(255) for storing "keywords" in mysql. We are facing a problem that mysql ignores all trailing spaces for comparison purposes in "=". It does respect trailing spaces in "like" comparison, but it does not let us store same word with and without trailing spaces in a varchar column if it has a "UNIQUE" index over it. So,...

How do I show the pound sterling (£) sign in Java Swing?

Currently, I add a pound sterling () sign to the Java source and compile the resulting Swing component shows as the square (unsupported character) symbol. I suspect it's an encoding problem, the Java source file is encoded as cp1252 (Eclipse seems to default to this). What's the correct way of resolving this? ...

Do certain characters take more bytes than others?

I'm not very experienced with lower level things such as howmany bytes a character is. I tried finding out if one character equals one byte, but without success. I need to set a delimiter used for socket connections between a server and clients. This delimiter has to be as small (in bytes) as possible, to minimize bandwidth. The curren...