string manipulation

Scanzee

Member
Joined
May 26, 2007
Messages
23
Programming Experience
1-3
hi folks

I'm making a application where I need to read some html files and get important information. Now I can't figure out how to get rid of this character:
�.
I have tried everything but I only get errors or weird solutions.

Thanks
 
where 's' is the string:
VB.NET:
s = s.replace("�", "")
There could of course be reasons for that character that would be better to solve than removing it. For example if you have used wrong text encoding, or perhaps it is the remainder of a line split where part of the newline (cr/lf) remains and displayed in a single line box like that.
 
Hmm when I do this the character changes into a red marker with a question mark in it. I really need something better to do this.
 
Provide better problem info and perhaps someone can help you.
 
VB.NET:
persoon.naam = strSource.Substring(count(i) + 6, p2 - count(i) - 6)
            persoon.naam = persoon.naam.Replace("�", " ")
When I try to do this the rectange changes into a red quadrangle with a white question mark in it. When I debug my code vs sais the encoding format is not correct or something like that. How do I have to solve this problem.
 
the square is just a generic visual presentation of non-printable character. You might need to put it in a loop and find the ascii value to find out what it actually is.

If my thinking is straight then doing that will reduce one of the two vbcr or vblf only which will still leave you with the other.

You can probably find two of them together and replace with vbcrlf.
 
Each character has a different ASCII or Unicode value.

The square symbol is a replacement for an unknown character. It could be for a font that was created on another computer and that is not present on your computer, or it could be a foreign language font/character. Each character is represented by a different ASCII or Unicode value. No one can "give" it to you -- it could be anything at all. Each unknown character is replaced by the same square. You need to find out what the value of that character is and then translate it into a font that exists on your computer. However, if it's a foreign language, your computer needs to be configured for it. Sorry, I don't have any further details.
 
It has nothing to do with languages or something because the website I get the text from is in de same language as my computer.
The problem is that is a html code character or something like that. But I really need something to handle this. Nobody who can help me?
 
Back
Top