|
-
May 3rd, 2013, 09:12 AM
#1
Thread Starter
Fanatic Member
weird characters showing up in html
I have a project that gets input from an xml file that we extract information from select nodes.
One of the does we take the info and just output in a <pre> tag since it's already formated from source.
We started seeing all these B's in the output so I ran a loop through all the characters and display the ascii value to see what it is and this is what I get in return.
How I get value:
Code:
For x=1 To Len(str)
result = result & Mid(str, x, 1) & "(" & Asc(Mid(str, x, 1)) & ")"
Next
Result for the character in question:
В (-15712)
Any ideas how I can strip these out?
Thanks.
-
May 3rd, 2013, 09:40 AM
#2
Re: weird characters showing up in html
Try:
Code:
str = Replace(str, ChrW(-15712), vbNullString)
BTW, your "weird" character appears to be a Korean character: 슠
Last edited by Bonnie West; May 3rd, 2013 at 10:12 AM.
Reason: Added link
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
-
May 3rd, 2013, 11:17 AM
#3
Thread Starter
Fanatic Member
Re: weird characters showing up in html
Thanks for the reply. That didn't work but did end up trying some regex and seems to work.
Code:
strPattern = "[^\x20-\x7E\t\f\n\r]"
strReplace = " "
outstr = RegExpReplace(outstr, strPattern, strReplace)
Function RegExpReplace(Str, Pattern, Replacement)
Set objRegExp = New RegExp
objRegExp.Pattern = Pattern
objRegExp.Global = True
objRegExp.IgnoreCase = True
RegExpReplace = objRegExp.Replace(Str, Replacement)
Set objRegExp = Nothing
End Function
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|