Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help identifying strange character

Status
Not open for further replies.

GezH

Programmer
Aug 7, 2002
68
Hi all. This isn't stricly a Perl question, but I'm posting here as I know that Perl gurus are generally pretty knowledgeable when it comes to character and encoding issues.

I have an app which is receiving XML from a service and parsing it, then displaying the data. The content is containing odd characters which we can't seem to get rid of. This character simply shouldn't be there, as all the proper content is displayed normally... the odd character just appears at the end of some lines, or where there should be whitespace. The service provider has tried various encodings, to no avail.

The character is being displayed as a capital A with a hat on.

Please, is there anything I can try searching/replacing, or some way I can try and identify what this character is?

Thanks.
 
Here's a quick sample:

Code:
char input = 'g';
System.out.print((int)input);

You should be able to adapt this to feed your input string into this to see the ascii value of each character.
 
Oops, sorry, my bad. I thought this was the java forum.

I'm sure there's a way to do this in Perl, but I'm still a novice here.
 
the equivalent Perl command would be:

$input = 'g';
print ord($input); # will print the decimal number 103
 
Dear KODR,

It's a few days ago, and your answer might have seemed simple... but you have no idea how much that has helped me.

Thank you!
 
Glad to hear it too - that Java code solved your Perl problem
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top