character

How to: Pass an ampersand in a lousy filename to a flash object on a webpage

Argghh. I have a site that offers audio previews of songs hosted elsewhere. Some file names have an ampersand in them - see below where it passes "soundFile." Anytime there's an ampersand, Flash can't get the file - I think it drops the filename after the ampersand. It doesn't matter if I pass it as an "&" or an HTML entity ("& a m p ;")...

Non-unicode XML representation

I have xml where some of the element values are unicode characters. Is it possible to represent this in an ANSI encoding? E.g. <?xml version="1.0" encoding="utf-8"?> <xml> <value>受</value> </xml> to <?xml version="1.0" encoding="Windows-1252"?> <xml> <value>&#27544;</value> </xml> I deserialize the XML and then attempt to serializ...

Why does strcpy trigger a segmentation fault with global arguments?

So I've got some C code: #include <stdio.h> #include <string.h> /* putting one of the "char*"s here causes a segfault */ void main() { char* path = "/temp"; char* temp; strcpy(temp, path); } This compiles, runs, and behaves as it looks. However, if one or both of the character pointers is declared as global variable, strcpy res...

How can I find repeated letters with a Perl regex?

I am looking for a regex that will find repeating letters. So any letter twice or more, for example: booooooot or abbott I won't know the letter I am looking for ahead of time. This is a question I was asked in interviews and then asked in interviews. Not so many people get it correct. ...

How do I create a string from one row of a two dimensional rectangular character array in C#?

I have a 2 dimensional array, like so: char[,] str = new char[2,50]; Now, after I've stored contents in both str[0] and str[1], how do I store it in a string[] s = new string[2]; ? I tried s[0] = str[0].ToString(); but that seems to be an error: VC# expects 'two' indices within the braces, which means I can convert only a cha...

What is the easiest/best/most correct way to iterate through the characters of a string in Java?

StringTokenizer? Convert the String to a char[] and iterate over that? Something else? ...

Easy way to shift specific characters in a string in C++?

As an example, if I have the string: ".....ZZ..ZZ....." or ".Z.1.Z.23Z.4.Z55" is there an easy way that I can shift each Z in that string one space to the right? Thanks in advance, Tomek Some additional test strings: ".Z" "Z." "ZZ." ".ZZ" "Z" "ZZ" "ZZZ" I think a few of the higher voted answers to this question (including the cu...

How to put unicode characters on a System.Windows.Forms.Button in C#?

In Visual Studio 2008 in a C# WinForms project, there is a button on a form. In the properties view, the property "Font" is set to "Arial Unicode MS". What do I need to put into the property "Text", so I get the unicode character \u0D15 displayed on the button? When I put \u0D15 into the "Text" property, the button displays the six cha...

C++ string manipulation

My lack of C++ experience, or rather my early learning in garbage collected languages is really stinging me at the moment and I have a problem working with strings in C++. To make it very clear, using std::string or equlivents is not an option - this is char* 's all the way. So: what I need to do is very simple and basically boils down...

SQLServer 2005 - Change character in NVarChar

I receive some arguments into a stored procedure. These arguments are NVARCHAR's. I have a problem, when I need to cast some of these values to FLOATS, because they are being received as e.g. @VALUE1 NVARCHAR(100) DECLARE @ChangedValue SET @ChangedValue = CAST(@Value1 AS FLOAT) E.g. @Value1 = "0,001" Gives me a problem, as it expect...

Output single character in C

When printing a single character in a C program, must I use "%1s" in the format string? Can I use something like "%c"? ...

How to concatenate characters in java?

How do you concatenate characters in java? Concatenating strings would only require a + between the strings, but concatenating chars using + will change the value of the char into ascii and hence giving a numerical output. I want to do System.out.println(char1+char2+char3... and create a String word like this. I could do System.out.pr...

How to change diacritic characters to non-diacritic ones

Hello, I've found a answer how to remove diacritic characters on stackoverflow, but could you please tell me if it is possible to change diacritic characters to non-diacritic ones? Oh.. and I think about .NET (or other if not possible) kind regards ...

Is there an upside down caret character?

I have to maintain a large number of classic ASP pages, many of which have tabular data with no sort capabilities at all. Whatever order the original developer used in the database query is what you're stuck with. So I want to to tack on some basic sorting to a bunch of these pages, and I'm doing it all client side with javascript. I ...

How do I erase printed characters in a console application(Linux)?

Hi all, I am creating a small console app that needs a progress bar. Something like... Conversion: 175/348 Seconds |========== | 50% My question is, how do you erase characters already printed to the console? When I reach the 51st percentage, I have to erase this line from the console and insert a new line. In my current ...

How should I count the number of occurrences of a character at the beginning of a string in PHP

The best that I have been able to come up with is: strlen(preg_replace('/^([\\*]*)\s(.+)/',"$1",$line)); ^^That seems to give the length of the string.^^ edit: I think that I should clarify that the character that I am trying to find is '*' ...

How will you print a character without library functions in C ?

If for example I should not use standard library functions like printf, putchar then how can I print a character to the screen easily. Is there any easy way of doing it. I dont know much about system calls and if I have to use them then how? So can any one advice an easy way of printing a character without using library functions?? Than...

What is the difference between a 'character' and an 'octet'?

I see the term 'octet' popping up in literature about nonces for hashing, and it seems to be synonymous with 'character', although there is a kind of pattern to how the words are used. This leads me to believe that there is a formal distinction between the two. If anyone could enlighten me to what it is, I'd appreciate it. (and please,...

How to split using a prefix character using regular expressions?

I would like to split the example string -- ~Peter~Lois~Chris~Meg~Stewie on the character '~' and have the result be Peter Lois Chris Meg Stewie Using a standard string split function in javascript or C# the first result is of course an empty string. I'd like to avoid having to ignore the first result because the first result may act...

java.net.MalformedURLException: Illegal character in URL

hi, I am working on struts.I am encrypting password in one application and passing encrypted password to another application through open url connection.Some times this works fine if i click on the link again system is throwing "java.net.MalformedURLException: Illegal character in URL".Please help me. ...