Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


VBScript building HTML hyperlink yields link with Diamonds with Question Mark Characters in it.

Posted on 2015-02-05
Medium Priority
Last Modified: 2015-02-06
I have some code that creates an html webpage with tracking information for shipped orders that recently stopped working correctly.

The vbscript code created the hyperlink and the user would click on the hyperlink and it would track the shipment.
Now the hyperlink has 956 diamond shaped characters with a question mark appended to the link.

UPS tracking looks like this:

The vbscript code to create the link I have is:

rs("TRACKING_INFO") = "1ZY9E1950366559999"

Case "UPS"
   If Len(rs("TRACKING_INFO")) > 0 Then
' replace carrige return line feed with string to concantante multiple tracking numbers
      sTrackingInfo = Replace(rs("TRACKING_INFO"),cHR(13) & CHR(10),"%0D%0A")
   End If
      strHTML = strHTML & "  <td><FONT SIZE = ""1""><a href=http://wwwapps.ups.com/WebTracking/track?HTMLVersion=5.0&loc=en_US&Requester=UPSHome&WBPM_lid=homepage%2Fct1.html_pnl_trk&trackNums=" & sTrackingInfo & "&track.x=Track>" & rs("TRACKING_INFO") & "</a></FONT></td>" & vbCrLf

Open in new window

The hyperlink looks fine, but when you click it, it opens:

If you remove the diamonds with question marks characters it works fine.

If you change your default browser from IE10 to Firefox it works fine.

Any Help would be greatly appreciated.
Question by:BFanguy
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
LVL 53

Accepted Solution

COBOLdinosaur earned 2000 total points
ID: 40591849
The diamond question represents unprintable characters in whatever character set the browser has been assigned.  The vbscript is probably emitting some additional characters after the text.  FF would eleminate those a trailing whitespace;  apparently IE 10 didn't do the transition to standards compliance very well, and is probably using a default character set other than utf-8.  With just the function it is hard to recommend a fix.  We would need to see the page; so a link would help.


Author Comment

ID: 40592225
Looks like this is a problem with converting binary to text from within VBScript.  
The tracking info is stored in a SQL BINARY FIELD.  I have to convert it to text.  It all looks okay within sql (no special characters), but when i write the converted text to a text file it has 908 extra characters.
LVL 53

Expert Comment

ID: 40592283
The strange thing is that it suddenly had a problem with IE when you went to IE 10.  I don't know why it would not truncate what should be considered whitespace.

7 Extremely Useful Linux Commands for Beginners

Just getting started with Linux? Here's a quick start guide that has 7 commands that we believe will come in handy.


Author Comment

ID: 40592394
I found that the Asc code for the invalid characters was 0, so i did a replace of all Chr(0) to "" and now it's working again.

cTrackinginfo = Replace(rs("TRACKING_INFO"),Chr(0),"")

Guessing earlier versions of IE truncated all invalid characters.


Author Comment

ID: 40594076
I've requested that this question be closed as follows:

Accepted answer: 0 points for BFanguy's comment #a40592394

for the following reason:

found work around
LVL 53

Expert Comment

ID: 40594070
Hmmm....... I guess describing what was causing the problem did not contribute to the solution. I'll have to remember that in the future.


Author Closing Comment

ID: 40594077
Sorry, i had clicked on the wrong answer.
LVL 53

Expert Comment

ID: 40594088
No problem.  I didn't file a formal objection. I just look a little strange to close it that way.  Thanks for coming back and correcting it.


Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question