invalid-characters

Valid characters in a Java class name

What characters are valid in a Java class name? What other rules govern Java class names (for instance, Java class names cannot begin with a number)? ...

XSLT: Cannot get xslt to output an (&) even after escaping the character.

I am trying to create a query string of variable assignments separated by the & symbol. (ex: "var1=x&var2=y&...") I plan to pass this string into an embedded flash file. I am having trouble getting an & symbol to show up in xslt. If I just type "&" with no tags around it there is a problem rendering the xslt document. If I type "&" w...

Struts2 Annotation-Validators for Invalid Chars

Heyall, While using Struts2, I am using several annotations to do my validations inside the Model class, in the set() methods, like: @RequiredStringValidator(message = "Name is required") @StringLengthFieldValidator(message = "Name must be between 5 and 60 characters", minLength = "5", maxLength = "60") p...

Is there a Python library function which attempts to guess the character-encoding of some bytes?

I'm writing some mail-processing software in Python that is encountering strange bytes in header fields. I suspect this is just malformed mail; the message itself claims to be us-ascii, so I don't think there is a true encoding, but I'd like to get out a unicode string approximating the original one without throwing a UnicodeDecodeError...

C# Sanitize File Name

I recently have been moving a bunch of MP3s from various locations into a repository. I had been constructing the new file names using the ID3 tags (thanks, TagLib-Sharp!), and I noticed that I was getting a System.NotSupportedException: "The given path's format is not supported." This was generated by either File.Copy() or Directory.Cre...

Base64 String throwing invalid character error.

I keep getting a Base64 invalid character error even though I shouldn't. The program takes an XML file and exports it to a document. If the user wants, it will compress the file as well. The compression works fine and returns a Base64 String which is encoded into UTF-8 and written to a file. When its time to reload the document into th...

Will string.Trim() ever remove *valid* characters from a filename?

I'm creating a class to store a filename. To do so, I need to know exactly which characters are invalid and exactly which characters are invalid as leading/trailing characters. Windows Explorer trims leading and trailing white-space characters automatically when naming a file, so I need to trim the same characters when constructing a f...

How To Parse XML With Invalid Characters in Node Name?

So I'm trying to parse some XML, the creation of which is not under my control. The trouble is, they've somehow got nodes that look like this: <ID_INTERNAL_FEAT_FOCUSED_EXPERTISE_(MORNINGSTAR) /> <ID_INTERNAL_FEAT_FOCUSED_EXPERTISE_(QUARTERSTAFF) /> <ID_INTERNAL_FEAT_FOCUSED_EXPERTISE_(SCYTHE) /> <ID_INTERNAL_FEAT_FOCUSED_EXPERTISE_(TR...

VB6 How to deal with the file name having invalid character

Hi all, I have created an application in VB6. I have to read attachments of a mail of client. But attached file has a name with invalid characters. I want to make the copy of it but my application cannot do it. So could u plz help me to solve this issue. Thanks in advance. EDIT: How can i check that the file name contains invalid ...

Parsing invalid ampersands with Android's XmlPullParsers

I am writing a little screen-scraping app that consumes some XHTML - it goes without saying that the XHTML is invalid: ampersands aren't escaped as &amp;. I am using Android's XmlPullParser and it spews out the following error upon the incorrectly encoded value: org.xmlpull.v1.XmlPullParserException: unterminated entity ref (position:...

filter/remove invalid xml characters from stream

First things first, I can not change the output of the xml, it is being produced by a third party. They are inserting invalid characters in the the xml. I am given a InputStream of the byte stream representation of the xml. Is their a cleaner way to filter out the offending characters besides consuming the stream into a String and proces...

Invalid character string partly recognized? c++

BLUF: In this function, \' prompt the error message but not \?, Why? char key[] = "\a\b\f\n\r\t\v\\\'\"#%&*;:<>\?/{|}~"; if (strpbrk(*local_str, key) != NULL ) { vico_param_out->out_valid = false; AfxMessageBox("L'identifiant de numérisation est invalide. Vous avez saisi des caractères qui ne peuv...