Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 663329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:28:39+00:00 2026-05-13T23:28:39+00:00

I have a script which tracks visits & referers to a website. I send

  • 0

I have a script which tracks visits & referers to a website.

I send the document.referrer (I use escape() in javascript) to the server
and store the string in the database, after decoding it using HttpUtility.HtmlDecode (C#).

For most cases, I can parse the referer string and show hebrew characters,
but there are a few cases which I cannot.

I found that the two strings are different (the one displays right and the one the doesn’t)

The one that displays right contains these kind of characters:
http://www.google.co.il/search?hl=iw&source=hp&q=%D7%99%D7%91%D7%95%D7%90%D7%A0%D7%99%D7%9D %D7%9C%D7%9E%D7%AA%D7%A0%D7%95%D7%AA &meta=&aq=f&oq=

The ones that doesn’t display properly (unless I use Microsoft.JScript.GlobalObject.unescape) look like this:
http://www.google.co.il/custom?q=%FA%EE%E9%F8 – %F6%E9%E9 %F8%EB%E1&client=pub-0385896995839253&forid=1

I can understand that the second string contains ISO-8859-1 characters, and works properly when unescaped on the server side, but there is no encoding information as part of a url

so, I cannot distinguish between these two formats. or can I? should I?

A note: when I copy & paste those urls in the browser address bar, the browser detects the first one as “Unicode(UTF-8)” and the other one as “Windows-1255”

Thanx
Yaron

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T23:28:40+00:00Added an answer on May 13, 2026 at 11:28 pm

    Use the encodeURIComponent function instead of the escape function.

    If you are reading the value from the Request.QueryString collection it’s already decoded, so you should not use the HtmlDecode method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 462k
  • Answers 462k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You should not keep any files under version control that… May 16, 2026 at 12:29 am
  • Editorial Team
    Editorial Team added an answer The second code snippet is not the correct way to… May 16, 2026 at 12:29 am
  • Editorial Team
    Editorial Team added an answer To fix the code in the Microsoft Enterprise Library source,… May 16, 2026 at 12:29 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.