Results 1 to 3 of 3

Thread: weird characters showing up in html

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2000
    Location
    Minnesota
    Posts
    830

    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.

  2. #2
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,060

    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)

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2000
    Location
    Minnesota
    Posts
    830

    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
  •  



Click Here to Expand Forum to Full Width